cyberbobcity
Programmer
- Jul 3, 2008
- 1
I have an app I created for my company a few years ago that I'd like to redesign not only with some nice web 2.0 stuff but also make the structure as "perfect" as possible.
I know right now there are current problems with the way work with classes. I have a piece of code that defines and instantiates one of every one of my classes, so I don't have to instantiate it every time I use it. This seems to be causing problems on very rare occasions since multiple people are using it. It just seems to be a pain instantiating my user class everytime i need it... what do i do?
other things that don't seem right is when I need to retrieve a combined set of properties from multiple objects to display in a table on a web site. Since for instance I want a list of users and the client name of that user. The client name is in the client class. So I basically just create a function in the user class saying GetUsersList() and it does a sql query bringing back all the fields I want, including the client name. It just seems off.
So basically my questions are:
1. What is a good reference on OOP design in a real world setting, not on polymorphism and inheritance, but how classes interact and are actually used.
2. Are there any good examples of realworld apps with very perfect coding.
3. What is the best way to get a list of a combined set of properties from multiple objects.
4. Are there best practices for instantiating classes globally instead of locally?
Thanks for any help you can give me.
I know right now there are current problems with the way work with classes. I have a piece of code that defines and instantiates one of every one of my classes, so I don't have to instantiate it every time I use it. This seems to be causing problems on very rare occasions since multiple people are using it. It just seems to be a pain instantiating my user class everytime i need it... what do i do?
other things that don't seem right is when I need to retrieve a combined set of properties from multiple objects to display in a table on a web site. Since for instance I want a list of users and the client name of that user. The client name is in the client class. So I basically just create a function in the user class saying GetUsersList() and it does a sql query bringing back all the fields I want, including the client name. It just seems off.
So basically my questions are:
1. What is a good reference on OOP design in a real world setting, not on polymorphism and inheritance, but how classes interact and are actually used.
2. Are there any good examples of realworld apps with very perfect coding.
3. What is the best way to get a list of a combined set of properties from multiple objects.
4. Are there best practices for instantiating classes globally instead of locally?
Thanks for any help you can give me.