T
thechaosengine
Hi all,
I have a very general but quite significant question about objects.
My question is, when should I create them? I know thats a crap question so
let me explain a bit further.
Lets take an example of user management against a database. Things I might
like to do include:
- Creating a new user
- Changing a users phone number
- Deleting a user
- Getting a users age
- Updating a users password
The thing with all this is not one of those operations require the
instantiation of a User object. You could do it through static methods.
The thing is, you the sort of operations above must make up 80% or so of all
operations on users. Likewise, operations similar to these ones effect most
business entities, be it a Bug or a Role or a Car object.
So my question is - is it really the case, that a good proportion of the
time, you dont need to instantiate an object at all to achieve your aims, or
am I using a poor approach to design my applications?
Many thanks to anyone who can share some advice.
Kindest Regards
tce
I have a very general but quite significant question about objects.
My question is, when should I create them? I know thats a crap question so
let me explain a bit further.
Lets take an example of user management against a database. Things I might
like to do include:
- Creating a new user
- Changing a users phone number
- Deleting a user
- Getting a users age
- Updating a users password
The thing with all this is not one of those operations require the
instantiation of a User object. You could do it through static methods.
The thing is, you the sort of operations above must make up 80% or so of all
operations on users. Likewise, operations similar to these ones effect most
business entities, be it a Bug or a Role or a Car object.
So my question is - is it really the case, that a good proportion of the
time, you dont need to instantiate an object at all to achieve your aims, or
am I using a poor approach to design my applications?
Many thanks to anyone who can share some advice.
Kindest Regards
tce