T
Tony Johansson
Hello!
Suppose you review your code and notice that a number of your domain objects
share similar properties and methods.
Let's say the objects Customer, Vendor, Manufacturer, SalesAgent and Product
all contain properties for Id and Name and methods for Get, Save and Delete.
In this case I can create an Interface with these Id, Name, Get, Save and
Delete and have these five classes
implement this Intarface.
Now to my question what advantage will this give me.
I can't right now see any advantages doing this but I do know that almost
everybody will tell me that's a good thing to do.
I hope somebody can tell me something about why I should do it.
//Tony
Suppose you review your code and notice that a number of your domain objects
share similar properties and methods.
Let's say the objects Customer, Vendor, Manufacturer, SalesAgent and Product
all contain properties for Id and Name and methods for Get, Save and Delete.
In this case I can create an Interface with these Id, Name, Get, Save and
Delete and have these five classes
implement this Intarface.
Now to my question what advantage will this give me.
I can't right now see any advantages doing this but I do know that almost
everybody will tell me that's a good thing to do.
I hope somebody can tell me something about why I should do it.
//Tony