views:

79

answers:

1

I have a question about how I setup my BO's.

I setup the BO's to contain all of my properties of the object as well as the business logic to satisfy the business rules. I decided to make all of the methods static, but I'm not sure if that was the right decision. Someone told me to split my BO's into an Entity Object of just properties and then a BO of just methods that do business rules, and don't make the methods static.

Does anyone have some experience with the way i've set this up? Any examples of how it might work better for future growth?

Thanks!

+1  A: 

First of all, make your application layered.

Second of all, if you are doing OOP, don't make your methods static when they don't have to be. Data and behavior go together, so methods working on/with instance data should never be static. (I'm guessing that you are using a "traditional" OO language like Java/C#.)

Then you can choose whether you want a rich domain model or want to use more lightweight ("anemic") transaction scripts for example.

This article on domain-driven design might be of interest.

eljenso