Contents
Where should business logic be?
data model
Business logic should live in the data model. And, what’s more, it should live in the graph data model because that’s the right abstraction for the next twenty years. If you’ve been paying attention to this blog or to Stardog generally, then you must have known this is where we were going to end up.
Why do we need service layer?
The service layer is there to provide logic to operate on the data sent to and from the DAO and the client. Service layer provides code modularity,the business logic and rules are specified in the service layer which in turn calls DAO layer ,the DAO layer is then only responsible for interacting with DB.
Which is the repository object or business logic layer?
I have a repository object which load data to a POCO. I have also created a Business logic layer which adds a little bit of functionality but basically wraps the POCO. So in the end I have a BLL which loads DAO with usage of repository. I am not very happy with this solution.
Where to put facade pattern in business logic?
Put it in another repository (BusinessRuleRepository) and have CustomerRepository use it. If the business logic is only limiting the results a user can see you might want to use a Facade pattern with a factory.
Why is there a minimal business logic layer?
We have a minimal business layer at this point, but the real reason is that it’s thin is that there’s way too much (legacy) business logic embedded in web page code-behinds. As that gets refactored, I expect the business layer to grow and grow and grow. This is fairly standard layering.
Which is a valid pattern for business logic?
Both are completely valid patterns. #1 has a discrete business operation tier, but suffers from an Anemic Domain Model. #2 can lead to big domain entities if you domain starts to become complicated, or if a model can do a lot of things. I mostly agree.