ASP.NET Enterprise Architecture: Business Layer

I am an ASP.NET/C# developer and I have been working in this field for two years now. I recently joined a new ASP.NET project where the enterprise architecture guy is pretty absent. Because of this situation, I am trying to understand the pros and cons of some unusual solution.

What I noticed most was that he created a business layer where each object in real time is a collection of an object.

public class User : List < User > {}

      

Even I know I have to ask these questions to those who created this structured structure, but I would like to know if someone can tell me about the benefits of defining an object as a collection in the business layer.

+2


source to share


2 answers


Without any other context, I will at least say that modeling business objects (like the User class, for example) should be modeled using object oriented templates. A user in my world represents one person on the system and therefore seldom represents a collection of users by itself. So letting the User class inherit the list of users doesn't make any sense to me.



+2


source


What if you want to return a collection of users to the UI. Let's say you want to bind it to a gridview using this generic list.

something like..



public class UsersList: List <User> {}

Respectfully,

0


source







All Articles