Here's my scenario. There are three use cases required by the user for essentially the same database table; however, there is a flag on the database table which determines the state of the BO. Since the state of the object follows a strict workflow, I have decided to create 3 different business objects that inherit from one base object. The business logic differs for each state of the BO (some fields are required instead of others for each state, etc.).
Here are the states of my business objects: Open, Pending, Distributed.
It must start in Open (when creating a new BO), go to Pending, then to Distributed; however, when it reads from the database, it can be in any of these three states. I am struggling with how I will create a method that will return the correct BO from the DAL based on the flag on the database. It sounds like a perfect candidate for the Factory Pattern, but I'm not sure how the structure will look. If anyone can provide some insight, I would ...
Go to the complete details ...