none
Still need a Model layer while having a Business Logic layer? RRS feed

  • Question

  • hi, in a asp.net solution, what would you do to a Model project when you have a Business project?

    On the interface, I find it very easy and effective to use an objectdatasource mapped to a class which does all the CRUD. I put that class in side the Business project. The class contains linq queries that gets and sets the data from/to the database.

    So what is left to the Model project then? the interface talks to the Business project just fine. Is there anything more or better can be done here?

    and here's more question, what is supposed to be in your data access layer then if you use Linq to SQL? only DBML files?

    Monday, June 6, 2011 7:55 AM

All replies

  • The model is whatever provides your data.

    That can be one layer or several spread across machines.

    With small systems there's only overhead in splitting up layers - all it adds is complication.

    If you instead had huge numbers of concurrent users then you may need to spread load across multiple servers caching business objects.

    Then your one layer just doesn't work.

    In small systems I've worked on there's no real separate layer at all for my data access other than the database server of course.

    Larger systems, well you need a more sophisticated approach.

    Monday, June 6, 2011 1:35 PM
  • It depends on many factors. What are you referring to when you mention about the business project? Does it represent the business entities?

    I assume that when you say Model, its about domain model. As you must be aware that the database are relational things and domain entities can be represented as objects. When you use LINQTOSQL it creates entities mapped to database tables but in this case not necessary these represent the domain objects. e.g. you have domai object a Person which has mutliple addresses. This would be generally represented in database in seprate tables but on domain layer you want Person object having Collection of addresses. When you have such obejct it can be called domain /model.

    Hopefully you are not referring model which pertains to MVC pattern.

    As rightly put by Andy, for smaller systems you may not have to bother about data, data access or BLL. It depends on the other criterias like

    1. Performance

    2. Scalability

    3. Ressability

    4. Maintainibilty

    On your last question , when you have LINQTOSQL, stiil you could use service as DAL which would facilitate the data access through LINQTOSQL.

    Hope this helps.


    Please mark this as "Answer" or "Vote as helpful" if it has resolved your issue/question/problem.
    • Proposed as answer by Vishvvas Sunday, June 19, 2011 7:03 PM
    Friday, June 17, 2011 11:38 AM
  • Hello very sexy boys,

    Do rethink the approach of using business layer, the business layer is only used if there is an implemention of business logic for your particular functional requirment.

    Cheers and Good Luck

     

    Miss . E

     

     

     

    Monday, June 20, 2011 6:20 AM