Desgin business object
I have a question about how I set up my BOs.
I am setting BO to contain all of my object properties as well as business logic to satisfy business rules. I decided to make all methods static, but I'm not sure if this was the right solution. Someone told me to split my BO into an Entity Object of only properties and then BO only into methods that enforce business rules, and don't put the methods in static ones.
Does anyone have any experience with how I set this up? Any examples of how this might work better for future growth?
Thanks!
a source to share
First of all, make your application layered .
Secondly, if you're doing OOP, don't make your methods static when they shouldn't be. Data and behavior go together, so methods that work on instance data should never be static. (I am assuming you are using a "traditional" OO language such as Java / C #.)
Then you can choose whether you want a rich domain model , or want to use more light ( "anemic" ) transaction scenarios .
This article on domain design might be of interest.
a source to share