I need to create 5 similar windows forms with a little bit of changes on each of them. One may have a couple of extra text boxes, other may have less fields. The datatables would be separate but the functionality would be the same. I’ll create a dataset with all the relevant TableAdopters in it. Then I’ll have another layer of “Business Logic” to fill up the data in the tables. What would be the right approach for creating forms using “object oriented” technique and how can I implement this?
Share
Like Steven says you should really look at composition over inheritance, so make smaller controls which do exactly what you need then just add a few of them into each form. However if you are really set on inheriting you can do so with Winforms, I am pretty sure there is a wizard which even lets you inherit from an existing form.
OOP is different depending on who you talk to, if its someone from a C++ background then they will no doubt say polymorphism and inheritance in the context of oo, however if you talk to people from Java and .net about OO they will probably focus more on encapsulation and composition.
Inheritance still has its place, just most problems can be solved easier and better via composition.