Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# WCF
What is the difference between using Entity framework self tracking entities and implementing Unit of work architecture? As i understand both are keep tracking of the objects, one db call for commit changes. So i cant figure out the difference of those. can some one point me about what should used in which case?
I'm using entity framework 5 with WCF service application.
Posted 27-Mar-13 5:44am
Comments
DinoRondelly at 27-Mar-13 14:15pm
   
You should use google and investigate on your own. The pros and cons of each should be readily available through a well formatted search. I mean unless you want a bunch of links from someone else who does the search for you.
Chamika Sandamal at 27-Mar-13 14:24pm
   
So you think i'm just asking questions without searching? nop man i searched but i haven't found a valid information as i expected. that's why i ask this question
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Entity framework self tracking is a kind of unit of work.
more link about ef and unit of work
http://stackoverflow.com/questions/6843006/is-unit-of-work-pattern-required-in-entity-framework-4-0
http://stackoverflow.com/questions/7940854/is-unit-of-work-and-repository-patterns-very-useful-for-big-projects#7941017
  Permalink  
v2
Comments
Chamika Sandamal at 28-Mar-13 7:47am
   
yes i know that self tracking is kind of unit of work. that is why i'm asking any purpose of using unit of work instead of self tracking entities.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

I have find out your response it is very clear to understand the answer:
1- They are the same when you look thir purpose because they will aply the changes all together to the databse
2- You can prefere Self Tracking because: Self Tracking simply ready to use with a variety of working capasity (Because it has many implemented methods)
3- You can prefere UnitOfWork because: You can add your methods according to your needs as like as RoleBack but also you can add those to the selftracking if you agree current implementation
 
Smile | :)
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 315
1 Jochen Arndt 190
2 DamithSL 125
3 PIEBALDconsult 110
4 Garth J Lancaster 90
0 OriginalGriff 5,790
1 DamithSL 4,601
2 Maciej Los 4,012
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,195


Advertise | Privacy | Mobile
Web03 | 2.8.141220.1 | Last Updated 3 Oct 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100