Im pretty new to OOP and im having a couple of problems designing the classes.
Heres the scenerio:
I have a List which contains: ListID, ListName, TelephoneNumbers (this could be 1 to 1,000,000 numbers)
Designing a class for this would I be right in thinking that I would need a class for List (object), TelephoneNumber (object) and ListManager (Methods).
Then in the List class I would have the private variable as a Generic.List, Ive been reading up on this and I understand the principle I think but im just having difficulty when a Class needs to use another Class within it.
Do I have the right idea or is there a better way of doing this?
Regards
Nigel
Hi Nigel
That all depends from the methodology you are using. From my experience for small scale projects the best approach is data-driven design.
First identify data you require and then using common sense or database normalization rules (Google it) design your database. It seems to me that in the case above ListID and ListName would belong to one database table while telephoneNumbers would belong to the other with listID as a Foreign Key constraint.
Once you have it don use LLBL Data Layer Generator (www.sd.nl look in open source) 1.21 version which is free. (not the Pro one unless you have money to burn). Use it to generate your stored procedures and classes and voila you have your data and data access layer done.
Look into LLBL documentation to learn how to consume generated classes.
0 comments:
Post a Comment