designing with classes - pointless?
Posted: Mon Jul 10, 2006 12:12 pm
Hello
I'm currently designing a online system for real estate upload. The developers would upload real estate and users would review the uploaded estates.
I can design the system with a user as the parent class and then the developer would extend it (as it has more functionality / properties). But, surely, it would be easier to display pages based on a user type stored in a mysql db? Ie. a 'user' table would store all details about users and developers - with a type field to determine what type of pages would be shown to those people.
I suppose my real question is : why design a system using classes (esp in this instance) when using a db and simple if then else statements solve the problem? Surely, sessions store persistant data and so what is the point having these classes and objects?
I understand that objects make sense in an environment where the state of something changes frequently (such as a shopping cart), but when you define items / people / processes as classes you add another layer to your programming that could be deemed as unnecessary. I suppose it's down to individual circumstance...
Sorry - just confusing myself but does anyone have any _logical_ reason for using classes in the environment I'm talking about?
Cheers
Cj
I'm currently designing a online system for real estate upload. The developers would upload real estate and users would review the uploaded estates.
I can design the system with a user as the parent class and then the developer would extend it (as it has more functionality / properties). But, surely, it would be easier to display pages based on a user type stored in a mysql db? Ie. a 'user' table would store all details about users and developers - with a type field to determine what type of pages would be shown to those people.
I suppose my real question is : why design a system using classes (esp in this instance) when using a db and simple if then else statements solve the problem? Surely, sessions store persistant data and so what is the point having these classes and objects?
I understand that objects make sense in an environment where the state of something changes frequently (such as a shopping cart), but when you define items / people / processes as classes you add another layer to your programming that could be deemed as unnecessary. I suppose it's down to individual circumstance...
Sorry - just confusing myself but does anyone have any _logical_ reason for using classes in the environment I'm talking about?
Cheers
Cj