what is best method of designing objects

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This is a software design question. What is the best way to design an object, such as a person, that will have a lot of methods and properties

Option 1. All methods and properties in the person object
Option 2. All properties in the person object and the methods are stored in a person handler object that takes a person and acts on it
Option 3. All properties in the person object and the methods are stored in a static person handler object that takes a person and acts on it
Or another option
 
Jason said:
This is a software design question. What is the best way to design an
object, such as a person, that will have a lot of methods and properties?

Option 1. All methods and properties in the person object.
Option 2. All properties in the person object and the methods are stored
in a person handler object that takes a person and acts on it.
Option 3. All properties in the person object and the methods are stored
in a static person handler object that takes a person and acts on it.
Or another option?

I prefer option 1 most of the time, but all three are valid approaches in
some situations. Most of the time, the object itself should support its own
operations.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top