SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2009
    Location
    A city equidistant from two coasts of India.
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question How is MVC different from EF?

    I am new to Entity Framework. While mapping model to database, I am wondering how it differs from MVC pattern. In MVC also, methods are mapped to URL (correct me if I am wrong).

    Can EF also become a part of an MVC project?

  2. #2
    Chopped Liver bronze trophy imaginekitty's Avatar
    Join Date
    Aug 2007
    Location
    Pennsyltucky
    Posts
    1,494
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    That's sort of like saying "how is mashed potatoes different from butter". :shrug:

    EF is commonly used in an MVC project. I'm not sure I can answer your question as I can't pinpoint your conceptual error.

  3. #3
    Resident OCD goofball! bronze trophy Serenarules's Avatar
    Join Date
    Dec 2002
    Posts
    1,911
    Mentioned
    26 Post(s)
    Tagged
    0 Thread(s)
    MVC, or Model-View-Controller, is an architechtural pattern that separates user interface, business logic, and presentation.
    Entity Framework, is an object oriented persistence engine, as opposed to simply using SqlConnection and SqlCommand.

    An application built on MVC can utilize EF, in much the same way as WebForms can use ADO.NET, or any combination thereof.

    Hope that helps.

  4. #4
    SitePoint Member
    Join Date
    Oct 2011
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Serenarules View Post
    MVC, or Model-View-Controller, is an architechtural pattern that separates user interface, business logic, and presentation.
    Entity Framework, is an object oriented persistence engine, as opposed to simply using SqlConnection and SqlCommand.

    An application built on MVC can utilize EF, in much the same way as WebForms can use ADO.NET, or any combination thereof.

    Hope that helps.
    Totally agree with it. Few use EF and few use microsoft applications blocks.

  5. #5
    Resident OCD goofball! bronze trophy Serenarules's Avatar
    Join Date
    Dec 2002
    Posts
    1,911
    Mentioned
    26 Post(s)
    Tagged
    0 Thread(s)
    True. Most use FluentNHibernate, or, if they are DDD / CQRS purists they use just plain old NHibernate and don't expose any properties on their business entities. Fluent mappers require something public to grab on to. Raw NHibernate doesn't. But then, that wasn't exactly his question. Not sure why I posted this. =/

  6. #6
    SitePoint Member
    Join Date
    Oct 2011
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Serenarules View Post
    True. Most use FluentNHibernate, or, if they are DDD / CQRS purists they use just plain old NHibernate and don't expose any properties on their business entities. Fluent mappers require something public to grab on to. Raw NHibernate doesn't. But then, that wasn't exactly his question. Not sure why I posted this. =/
    Guess he wants to know the how different is EF is from MVC as MVC being a design pattern it cannot be compared to EF as it eliminate the mismatch between data models and between languages that one would otherwise have to deal with new features available in the upcoming version of ADO.NET.

  7. #7
    SitePoint Enthusiast
    Join Date
    Oct 2009
    Location
    A city equidistant from two coasts of India.
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question

    I am not following the advantages of ORM other than separation of concerns. How persistence of objects can help me when comparing with the old SqlCommand objects?

  8. #8
    Resident OCD goofball! bronze trophy Serenarules's Avatar
    Join Date
    Dec 2002
    Posts
    1,911
    Mentioned
    26 Post(s)
    Tagged
    0 Thread(s)
    rpk, I'm going to go against the fad and remind people, and you, that sometimes it really is an eye-of-the-beholder kind of thing. Personally, I use them because, as a single-man company, with a lack of real T-SQL savvy, I can make complex sql calls with Linq extensions to whatever ORM I'm using is. They also have nice sanitzation elements built in, that I'd otherwise have to worry about. On the other hand, if I knew more about T-SQL, db management and such things, I might be tempted to use something more direct myself. Listen to all the hype, and all the pros and cons. Then make up your own mind. =)


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •