Question: Object_Orientation in VB.NET? I have got a program where I should extensively implement object-oriented features of the vb.net. I have got a class tenant and a class room, both belong to some dormitory. In that dormitory class i have 2 array lists to store objects of class tenant and room respectively. In class tenant I created association with the class room, so I may see in which room every tenant lives. However I did not create association in the room class in order to avoid data duplication.  \n\nInstead if I want to lookup which tenant lives in some particular room, I first get the room number from the rooms array list and then I lookup the same room no in the tents list and retrieve the corresponding tenant's name. \n\nI am not sure whether this approach is fine, anyway it provides me info I need. But I am not sure whether it is object oriented enough? Should I create an association to tenant class in the room class? \n\nSomeone told me that class should be a complete entity and hold all the info it is suppos

Answer: I think your approach is fine, but if you want to learn to use OO you should read a Design Patterns book, or THE book by the gang of 4 Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides.\n\nYou can check out this site or get newer books that cover this in .NET or Java \n\nI agree that OO just for no reason makes the code hard to understand, but in some cases it can save you a lot of work on the long run.\n\nDesign patterns are proven solutions to reoccurring problems in software, so why re-invent the wheel.\n\nIf you want to see patterns in action in .NET you can look at the source code for Enterprise Library for .NET Framework 2.0.
This question from the Yahoo Q&A forum is categorized in the topic: Health