Putting logic in entity class which extends datalayer entity

125 views Asked by At

I have a question regarding Layered architecture. We are drafting a layered architecture and we have decided to have a data layer, Business layer and the front with viewmodels. My question is regarding the Business layer and where to put the logic. The data layer (webservice layer) will get all the data and transform the data to our own entities say a class called DataLayerEntityClassA. In the business layer we have a class BusinessLayerClassA which are taking this transformed data (DataLayerEntityClassA) and doing some logic say sorting. When we are finished with the logic we return BusinessLayerEntityClassA which inherits the class DataLayerEntityClassA. The class BusinessLayerEntityClassA is in the BL layer and contains some simple logic for searching, querying the DataLayerEntityClassA entity. Is this good practice or should this simple logic be in class BusinessLayerClassA? Are there any pitfalls in doing this way?

We are using c# .net 3.5 if that matters.

0

There are 0 answers