-5

How can I name an abstract class that has a common part of view of my two panels? One of them is for creating an object and the other one is for updating it. I want to keep these view in different classes to maintain SRP.

  • 1
    "I want to keep these view in different classes to keep SRP." SRP is widely misunderstood and abused. Other than that your question seems to be primarily opinion based. – πάντα ῥεῖ Mar 14 '18 at 19:58
0

One of them is for creating an object and the other one is for update it.

You shouldn't have 2 views for that at all. Views are meant to collect the data input from the GUI, not to introduce the logic, if an underlying data set should be created or just updated.

I'd rather recommend you should have a single view panel for that data, and manage to create a new or update an underlying data set, in a separate layer, that communicates with the database.

The "single responsibility principle" rather means that the view should be responsible for collecting the necessary data, and doing (primitive) input validation of that data.

An underlying data set should carry the information, if there's need to create a new record, or to modify (update) an existing one, if the user commits the data from the view panel.

Thus your question of "how to name an abstract base class" for these becomes completely irrelevant, because there isn't one.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.