<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Discussion about API changes necessary for POCO:</title><link>http://blogs.msdn.com/efdesign/archive/2008/08/01/discussion-about-api-changes-necessary-for-poco.aspx</link><description>Evolving an API to support new requirements, like POCO, while maintaining backward compatibility is challenging. The following design discussion from members of the Object Services team illustrates some of the issues and hard calls involved. Have a read,</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>a-foton &amp;raquo; Discussion about API changes necessary for POCO:</title><link>http://blogs.msdn.com/efdesign/archive/2008/08/01/discussion-about-api-changes-necessary-for-poco.aspx#8800745</link><pubDate>Fri, 01 Aug 2008 19:51:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8800745</guid><dc:creator>a-foton &amp;raquo; Discussion about API changes necessary for POCO:</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://blog.a-foton.ru/2008/08/discussion-about-api-changes-necessary-for-poco/"&gt;http://blog.a-foton.ru/2008/08/discussion-about-api-changes-necessary-for-poco/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: Discussion about API changes necessary for POCO:</title><link>http://blogs.msdn.com/efdesign/archive/2008/08/01/discussion-about-api-changes-necessary-for-poco.aspx#8805262</link><pubDate>Sat, 02 Aug 2008 12:01:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8805262</guid><dc:creator>Kosher</dc:creator><description>&lt;p&gt;I certainly hope this isn't replacing ADO.NET. &amp;nbsp;I do appreciate the rewrite and there are some drawbacks to the existing ADO.NET paradigm but I think it has evolved quite nicely with the introduction of LINQ to DATASET.&lt;/p&gt;
&lt;p&gt;I hope you realize this is duplicating many of the ideas and features that already exist in DataSets.&lt;/p&gt;
</description></item><item><title>re: Discussion about API changes necessary for POCO:</title><link>http://blogs.msdn.com/efdesign/archive/2008/08/01/discussion-about-api-changes-necessary-for-poco.aspx#8806084</link><pubDate>Sat, 02 Aug 2008 20:39:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8806084</guid><dc:creator>dsimmons@microsoft.com</dc:creator><description>&lt;p&gt;The Entity Framework will not replace ADO.NET--it builds upon ADO.NET, and we will support both. &amp;nbsp;There will continue to be reasons for using ADO.NET. &amp;nbsp;It might be that this is just the style of coding you prefer or it might be that you want to use the EF but occassionally need to go around the EF and talk more directly to the DB or whatever.&lt;/p&gt;
&lt;p&gt;The EF has its place and so does ADO.NET (including DataSets).&lt;/p&gt;
&lt;p&gt;- Danny&lt;/p&gt;
</description></item><item><title>re: Discussion about API changes necessary for POCO:</title><link>http://blogs.msdn.com/efdesign/archive/2008/08/01/discussion-about-api-changes-necessary-for-poco.aspx#8833679</link><pubDate>Tue, 05 Aug 2008 13:37:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8833679</guid><dc:creator>jstangroome</dc:creator><description>&lt;p&gt;Regarding Q3, a big pain with DataSets is that invalid data cannot be entered. Sure, invalid data should not be able to be committed to the database but the in-memory object should be able to be in an inconsistent state until the app/user corrects it.&lt;/p&gt;
&lt;p&gt;Therefore EF POCOs should allow invalid state without throwing exceptions.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;--&lt;/p&gt;
&lt;p&gt;Jason&lt;/p&gt;
</description></item><item><title>Entity Classes &amp; Architecture Patterns</title><link>http://blogs.msdn.com/efdesign/archive/2008/08/01/discussion-about-api-changes-necessary-for-poco.aspx#8846191</link><pubDate>Sun, 10 Aug 2008 11:09:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8846191</guid><dc:creator>system.data.objects dev guy</dc:creator><description>&lt;p&gt;Entity Classes &amp;amp;amp; Architecture Patterns Part of the Entity Framework FAQ . 2. Architecture and Patterns&lt;/p&gt;
</description></item><item><title>Entity Classes &amp; Architecture Patterns</title><link>http://blogs.msdn.com/efdesign/archive/2008/08/01/discussion-about-api-changes-necessary-for-poco.aspx#8846209</link><pubDate>Sun, 10 Aug 2008 11:12:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8846209</guid><dc:creator>system.data.objects dev guy</dc:creator><description>&lt;p&gt;Entity Classes &amp;amp;amp; Architecture Patterns Part of the Entity Framework FAQ . 2. Architecture and Patterns&lt;/p&gt;
</description></item><item><title>re: Discussion about API changes necessary for POCO:</title><link>http://blogs.msdn.com/efdesign/archive/2008/08/01/discussion-about-api-changes-necessary-for-poco.aspx#8848256</link><pubDate>Mon, 11 Aug 2008 18:19:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8848256</guid><dc:creator>Colin Jack</dc:creator><description>&lt;p&gt;Q1 - UOW and validation, whilst UOW is great it would be good if we could perform validation before you commit to ensure that totally invalid information is not persisted. &amp;nbsp;This should be done in a nice clean way and should allow us to do the validation any way we choose.&lt;/p&gt;
&lt;p&gt;Q2 - Make it implicit so alternative 2. People are used to the UOW pattern so I think this approach is fine. &lt;/p&gt;
&lt;p&gt;Q3 - Just throw the exception at the last minute, this isn't a major issue so in my view so don't worry about it. Reassigning the ID of a mapped class is a coding error and if we don't catch it in tests an exception at run-time is totally fine. EntityState is not an attractive option at all.&lt;/p&gt;</description></item><item><title>re: Discussion about API changes necessary for POCO:</title><link>http://blogs.msdn.com/efdesign/archive/2008/08/01/discussion-about-api-changes-necessary-for-poco.aspx#8849997</link><pubDate>Tue, 12 Aug 2008 08:58:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8849997</guid><dc:creator>Jarod Ferguson</dc:creator><description>&lt;p&gt;I’ve had some issues with my comments not posting when logged in. Finally got a chance to type this again...&lt;/p&gt;
&lt;p&gt;-----&lt;/p&gt;
&lt;p&gt;#1 &lt;/p&gt;
&lt;p&gt;Tracking state to POCO entities/graphs while detached from the context&lt;/p&gt;
&lt;p&gt;-Scenarios: WCF/Web Services, SilverLight, ASP.NET presentation tier (non EDS)&lt;/p&gt;
&lt;p&gt;-----&lt;/p&gt;
&lt;p&gt;#2 &lt;/p&gt;
&lt;p&gt;Though DetectChanges is not ‘that’ intrusive (dev should be aware) it seems the default behavior should be ‘built-in’ as in alternative 2. I guess it would all come down to perf. Though a con of alternative 1 is potentially iterating through a large number of items in the state manager dictionaries, it seems as though the same issue might exist for alternative 2 ( as in saving changes). – Could it be possible to support both at some point by configuration?&lt;/p&gt;
&lt;p&gt;-----&lt;/p&gt;
&lt;p&gt;#3 – &lt;/p&gt;
&lt;p&gt;Invalid state seems as though it could have advantages being combined with other states. Again, it would be cool at some point to support both, defaulting to throwing exceptions by default with the ability to enable Invalid States.&lt;/p&gt;
&lt;p&gt;-----&lt;/p&gt;
&lt;p&gt;I think the best scenario is the Dynamic Proxy with notification based tracking. Would code enhancement (IL modification/injection) be an option vs. dynamic proxy to alleviate the need for virtual properties?&lt;/p&gt;
&lt;p&gt;If mixed mode was used I would prefer to call DetectChanges. It seems like it might be advantageous to have some properties state explicitly controlled, while others are tracking automatically with notification based. This would allow a dev to update parts of an entity. (Cant think of any good reason for this yet, but I’m sure I could find something)&lt;/p&gt;
</description></item><item><title>re: Discussion about API changes necessary for POCO:</title><link>http://blogs.msdn.com/efdesign/archive/2008/08/01/discussion-about-api-changes-necessary-for-poco.aspx#8850153</link><pubDate>Tue, 12 Aug 2008 10:19:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8850153</guid><dc:creator>Colin Jack</dc:creator><description>&lt;p&gt;&amp;quot;I’ve had some issues with my comments not posting when logged in. Finally got a chance to type this again...&amp;quot;&lt;/p&gt;
&lt;p&gt;Yeah I've had this every time I try to post on the EF blog, tried 4 times on one post and nothing appeared. Very frustrating.&lt;/p&gt;</description></item><item><title>re: Discussion about API changes necessary for POCO:</title><link>http://blogs.msdn.com/efdesign/archive/2008/08/01/discussion-about-api-changes-necessary-for-poco.aspx#8864661</link><pubDate>Thu, 14 Aug 2008 08:38:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8864661</guid><dc:creator>macsgold</dc:creator><description>&lt;p&gt;Add the ability to require a POCO entity to be explicitly 'registered' for snapshot tracking (including its relationships?). &amp;nbsp;E.g. POCOs may not all come from the context anyway. &amp;nbsp;This obviates the performance problem of DetectChanges having to iterate through too much, because you only have to iterate through what is registered (only a subset of entities may need to be modified).&lt;/p&gt;
&lt;p&gt;Snapshot (or notification) state management must support true 'savepoints' to model nested units of work (e.g. popup cancelable modal edit dialogs in a UI, or any type of undo to a pre-specified savepoint).&lt;/p&gt;
&lt;p&gt;Following on from the above, state managements need to support TransactionScope - i.e. implicit savepoints and rollbacks to them on a TransactionScope rollback. &amp;nbsp;Ideally to be able to participate in distributed transations.&lt;/p&gt;
&lt;p&gt;State managements need to be extensible (interface based), with events to hook or methods to override, and also be fully replaceable.&lt;/p&gt;
&lt;p&gt;DetachChanges() should be public and not throw exceptions for validation changes (separate structure or method for querying that). &amp;nbsp;EDM constraints are only a subset of an overall validation model so don't have exceptions dictate an implementation approach (i.e. the output of DetectChanges() is valuable with or without EDM validation errors). (Jason says this earlier.)&lt;/p&gt;
&lt;p&gt;Making and restoring (overwriting an entity) of snapshots of entities should be able to use a custom 'serialization' mechanism if desired, e.g. to support customization of the 'restore' process (talking about an undo or 'rollback' here) for any custom code that needs to be run (e.g. (re)setting any transient properties).&lt;/p&gt;
&lt;p&gt;POCO scenario: &amp;nbsp;'context-free', save-pointable, TransactionScope-aware, efficient querying of what is modified.&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;-Mat Hobbs&lt;/p&gt;
</description></item><item><title>re: Discussion about API changes necessary for POCO:</title><link>http://blogs.msdn.com/efdesign/archive/2008/08/01/discussion-about-api-changes-necessary-for-poco.aspx#8869970</link><pubDate>Fri, 15 Aug 2008 18:43:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8869970</guid><dc:creator>Eugene Burd</dc:creator><description>&lt;p&gt;1. &amp;nbsp;I have had times where it was not enough to know that an object was changed, but I actually needed to know what changed. &amp;nbsp;The fact that the object changed, means that it needs to be persisted; however, if I have another system that only cares about certain changes, i wouldn't want to notify it of these changes unless it was necessary.&lt;/p&gt;
&lt;p&gt;2. &amp;nbsp;Interesting dilemma. &amp;nbsp;From a pure academic point of view, I would say that since ObjectStateEntry.State is a property, best design practices would say it shouldn't do any heavy lifting (should be deterministic). &amp;nbsp;However, in this case, I think the best decision is to break this rule. &amp;nbsp;I just think its dangerous to return wrong values to a developer who is ill aware of the new changes to the API. &amp;nbsp;This is almost worse than breaking the interface, it preserves it, but alters the functionality. &amp;nbsp;So alternative #2 seems better to me. &amp;nbsp;One potential way to speed things up is to take a checksum of the scalar fields of an entity and store it along with the state. &amp;nbsp;That way when subsequent calls are made to properties / methods that require the recomputation of state, it could be done faster, since if the checksum was the same, you would know that there were no changes from the previous computation. &amp;nbsp;Just an idea. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;#3 - I don't have strong feelings on this one either way you go. &amp;nbsp;Since its too late to correct anything, it seems like throwing an error would be a good thing.&lt;/p&gt;
</description></item><item><title>re: Discussion about API changes necessary for POCO:</title><link>http://blogs.msdn.com/efdesign/archive/2008/08/01/discussion-about-api-changes-necessary-for-poco.aspx#8885530</link><pubDate>Thu, 21 Aug 2008 20:41:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8885530</guid><dc:creator>Alexnaldo Santos</dc:creator><description>&lt;p&gt;Q1, Q2 and Q3&lt;/p&gt;
&lt;p&gt;To manager business I need sinals to make decisions at any time, no matter scenarios. &lt;/p&gt;
&lt;p&gt;If I'm working with business objects (tables) and it have components (columns) &lt;/p&gt;
&lt;p&gt;I need to know the states of both at same time and together, no matter the Tier(WCF,ASP,WinForm, etc.).&lt;/p&gt;
&lt;p&gt;IMHO, IPOCO is the best option but without to implement many &lt;/p&gt;
&lt;p&gt;interfaces. I don't like the idea that another object(ObjectStateManager) &lt;/p&gt;
&lt;p&gt;control the states of objects.No problem to &amp;quot;identity management&amp;quot; but wrong for &amp;quot;State management&amp;quot;.&lt;/p&gt;
&lt;p&gt;If I'm bad I say to my doctor &amp;quot;I'm bad..&amp;quot; &lt;/p&gt;
&lt;p&gt;and not my doctor say to me &amp;quot;you are bad&amp;quot;. The state of me and any part of my &lt;/p&gt;
&lt;p&gt;body can't live out me. I think like it to object too.&lt;/p&gt;
&lt;p&gt;So, I would like to see in my objects :&lt;/p&gt;
&lt;p&gt;myObject.State &amp;nbsp; ( readonly, already exists )&lt;/p&gt;
&lt;p&gt;myObject.Undo() &amp;nbsp;( undo the changes )&lt;/p&gt;
&lt;p&gt;myObject.Columns[&amp;quot;MyColumn1&amp;quot;].State &amp;nbsp; &amp;nbsp; ( readonly, the state on my column )&lt;/p&gt;
&lt;p&gt;myObject.Columns[&amp;quot;MyColumn1&amp;quot;].OldValue &amp;nbsp;( readonly, the old value of my column )&lt;/p&gt;
&lt;p&gt;myObject.Columns[&amp;quot;MyColumn1&amp;quot;].Value &amp;nbsp; &amp;nbsp; ( readwrite, the current value )&lt;/p&gt;
&lt;p&gt;myObject.Columns[&amp;quot;MyColumn1&amp;quot;].Undo() &amp;nbsp; &amp;nbsp;( undo the changes )&lt;/p&gt;
&lt;p&gt;myObject.MyColumn1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;( readwrite, the current value )&lt;/p&gt;
&lt;p&gt;I'm using this approach with &amp;quot;Linq to Sql&amp;quot; and work very well.&lt;/p&gt;
&lt;p&gt;Now, I would like to &amp;quot;migrate&amp;quot; my objects to EF.&lt;/p&gt;
&lt;p&gt;My table will be like it :&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;[Serializable]&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;[DataContract]&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;public class MyIPocoClass : IEntity&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public MyIPocoClass()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;private EntityState _state;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[DataMember]&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public EntityState State&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;get { return _state; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[NonSerialized]&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;private EntityColumns _columns;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[XmlIgnore]&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public EntityColumns Columns&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;get&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (_columns == null)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;_columns = new EntityColumns();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;_columns.PropertyChanging += new PropertyChangingEventHandler(OnPropertyChanging);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;_columns.PropertyChanged += new PropertyChangedEventHandler(OnPropertyChanged);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return _columns;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public event PropertyChangingEventHandler PropertyChanging;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public event PropertyChangedEventHandler PropertyChanged;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;protected virtual void OnPropertyChanging(object sender, PropertyChangingEventArgs e)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (PropertyChanging != null)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;PropertyChanging(sender, e);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;protected virtual void OnPropertyChanged(object sender, PropertyChangedEventArgs e)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (PropertyChanged != null)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;PropertyChanged(sender, e);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[DataMember]&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public string MyColumn1&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;get { return Columns.GetValue(&amp;quot;MyColumn1&amp;quot;) as string; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;set { Columns.SetValue(&amp;quot;MyColumn1&amp;quot;, value); }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
</description></item><item><title>re: Discussion about API changes necessary for POCO:</title><link>http://blogs.msdn.com/efdesign/archive/2008/08/01/discussion-about-api-changes-necessary-for-poco.aspx#8889173</link><pubDate>Sat, 23 Aug 2008 02:44:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8889173</guid><dc:creator>jrista</dc:creator><description>&lt;p&gt;Q1: &amp;nbsp;WCF &amp;amp; Disconnected Entities. &lt;/p&gt;
&lt;p&gt;In v1 of EF, its a bit difficult to effectively use entities on the client in an SOA environment. Part of this is due to how the available tools generate WCF proxies...either it generates all types for you, or you can share the exact same types in the exact same assembly as the service. The problem with EF entities is they come with an ugly parent class chain from the System.Data.Entity assembly, and all that stuff ends up cluttering your Presentation Layer. POCO can solve this problem, since they are just plain old classes, but you have the problem of serializing a modified POCO graph back from the client to the service and persisting those modifications to your data store. &lt;/p&gt;
&lt;p&gt;There are some options here, like keeping the ObjectContext around until the UOW is complete...but that means keeping it around accross multiple calls to the service, which means plumbing code. You could wrap up all object graphs in a utility class that tracks changes for you on the client, but then your binding both your service and your clients to a utility class that gets in the way of clean, simple use of your entities. Some kind of mechanism is needed to keep track of state accross object context instantiations, and it should be transparent so that POCO entities in an SOA environment can be used as simply as possible without requiring loads of plumbing and support code to keep track of changes and apply those changes to the ObjectStateManager.&lt;/p&gt;
&lt;p&gt;Q2: Neither is better, both are neccesary. &lt;/p&gt;
&lt;p&gt;Your developing a base platform upon which thousands and eventually millions of applications will be built on top of. In my experience over the last 6-8 months, the greatest problem in EF is its seemingly endless LIMITATIONS. In its current form, EF has such a nitch place because it limits and restricts to the nth degree. For EF to become truely viable as an O/R Mapping platform that can provide true value to the very wide variety of applications written on and for the windows platform, you need to eliminate limitations and restrictions on what is possible. &lt;/p&gt;
&lt;p&gt;So, in regards to question 2...don't pick one...use both. Keep the framework as flexible as possible and support as many scenarios as possible. There is no one single way to write a program, and while there are few proper ways and many improper ways to implement a design, there are still a few proper ways. Support both state management methodologies, and you'll keep more people happy and make EF viable for the broadest range of applications.&lt;/p&gt;
&lt;p&gt;Q3: Don't Restrict and Limit.&lt;/p&gt;
&lt;p&gt;Just as in Q2, your building a base framework upon which applications will be built. Don't impose MORE limitations on the consumers of your framework...eliminate them. There are going to be times when temporarily having Invalid State for a property is going to be neccesary to support what a developer needs. By immediately throwing an exception, you completely eliminate that option, and force a developer to invest more time finding a way around your imposed limitation.&lt;/p&gt;
&lt;p&gt;Allow invalid state...only throw an exception when its absolutely neccesary (i.e. persisting state to the data store.)&lt;/p&gt;
&lt;p&gt;I think EF has immense potential, but my overall experience, and particularly my experience since the release of v1, has been dismal. I have effectively given up on implementing EF in the near future, possibly for the forseeable future, because of the boundless limitations that I am continually running into. Most of the practical, proven, and effective methodologies for software development, such as DDD (Domain Driven Design), offer wonderful guidelines to developing stable, maintainable, and extensible software...yet EF does not support these common architectures and scenarios except in very limited capacity. (i.e. EF is still highly data-driven and limited in its O/R Mapping capabilities, and does not allow the DOMAIN to drive design decisions...it enforces schema-bound restrictions). That should change with EF v2. &lt;/p&gt;
</description></item><item><title>re: Discussion about API changes necessary for POCO:</title><link>http://blogs.msdn.com/efdesign/archive/2008/08/01/discussion-about-api-changes-necessary-for-poco.aspx#8900576</link><pubDate>Wed, 27 Aug 2008 19:08:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8900576</guid><dc:creator>Shlomi</dc:creator><description>&lt;p&gt;Talking about snapshots - my wish for your next release is to see a rollback mechanism which supports TrasactionScope. if the scope fails - the context returns to what it was before the transaction. &lt;/p&gt;
</description></item><item><title>re: Discussion about API changes necessary for POCO:</title><link>http://blogs.msdn.com/efdesign/archive/2008/08/01/discussion-about-api-changes-necessary-for-poco.aspx#8900632</link><pubDate>Wed, 27 Aug 2008 19:22:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8900632</guid><dc:creator>Gatecrasher</dc:creator><description>&lt;p&gt;I created, like many others, entity classes derived from the database tables/Sp's. &amp;nbsp;I also implemented the &amp;quot;State&amp;quot; field (modified, deleted etc) and latched that to events used to implememt the databinding interfaces.&lt;/p&gt;
&lt;p&gt;Like someone else has said knowing it's changed is sometimes not enough, you need to know what has changed. &amp;nbsp;You could argue that if that is the case use a DataSet which implements the &amp;quot;before/after&amp;quot; model. This of course has the drawback in that it doubles that amount of data being passed around.&lt;/p&gt;
&lt;p&gt;The other area that needs consideration is DataBinding at the client. &amp;nbsp;Various interfaces allow data binding to &amp;quot;undo&amp;quot; changes (start/endedit) and synchronise code/screen updates through their respective managers. &amp;nbsp;Databinding works very well with datasets but not so well with Linq to SQL (I understand) so maybe some lessons there.&lt;/p&gt;
&lt;p&gt;My problem was with databinding and serialization. To support Databinding I implemented the required interface and the notification events. Tied into those properties I modifed the &amp;quot;state&amp;quot; at the same time.&lt;/p&gt;
&lt;p&gt;Of course the properties that raised these events are called by the serializer. &amp;nbsp;So during a web service call &amp;quot;everything&amp;quot; becomes &amp;quot;modified&amp;quot;. &lt;/p&gt;
&lt;p&gt;Being able to pass &amp;quot;work in progress&amp;quot; across serialization boundaries and have the state maintained is vital.&lt;/p&gt;
&lt;p&gt;Ideally the properties need to know when they are being called by the serializer and in .NET2 the XML serializer is not very helpful, there are no &amp;quot;before&amp;quot; and &amp;quot;after&amp;quot; events to latch onto. &amp;nbsp;The Binary serializer and WCF both implement these now I think.&lt;/p&gt;
&lt;p&gt;My &amp;quot;cludge&amp;quot; was to event a &amp;quot;first&amp;quot; and &amp;quot;last&amp;quot; property to set and clear a flag and fix the &amp;quot;field order&amp;quot;!! These properties would only ever get called when serializing (I hope) so could enable and disable the change events. &amp;nbsp;With WCF is can de-gludge my code I think.&lt;/p&gt;
&lt;p&gt;One thing I considered was using a Property/Hashtable type structure rather than the usual Property/Private field. &amp;nbsp;Optionally using 2 hashtables to store before and after. &amp;nbsp;The 2nd hashtable storing only fields that have changed and storing the original value. &amp;nbsp;Of course you need a serializable Dictionary&amp;lt;&amp;gt; object which I wrote too.&lt;/p&gt;
&lt;p&gt;I like the hastable approach, you only store twice at the field level when the field changes. &amp;nbsp;Any records in the 2nd table means &amp;quot;modified&amp;quot;. &amp;nbsp;No changes means no XML when serialized unlike a DataSet which always stores everything twice so doubles the XML created.&lt;/p&gt;
&lt;p&gt;Where I work data load across the network is a &amp;quot;big thing&amp;quot;, hence our interest in WCF and Binary serialization!!&lt;/p&gt;
&lt;p&gt;Breaking &amp;quot;hassle free&amp;quot; databinding is a reason we haven't touched Linq for SQL.&lt;/p&gt;
&lt;p&gt;My story is simply pointing out that serialization, data load size, network performance and support for client Data Binding must all be factored into any decision.&lt;/p&gt;
</description></item><item><title>re: Discussion about API changes necessary for POCO:</title><link>http://blogs.msdn.com/efdesign/archive/2008/08/01/discussion-about-api-changes-necessary-for-poco.aspx#8900652</link><pubDate>Wed, 27 Aug 2008 19:28:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8900652</guid><dc:creator>Gatecrasher</dc:creator><description>&lt;p&gt;I forgot to say that Dictionary&amp;lt;&amp;gt; objects do serialize the &amp;quot;key&amp;quot; which creates big XML too. &amp;nbsp;One reason I looked at it and then didn't bother!&lt;/p&gt;
</description></item><item><title>re: Discussion about API changes necessary for POCO:</title><link>http://blogs.msdn.com/efdesign/archive/2008/08/01/discussion-about-api-changes-necessary-for-poco.aspx#8937269</link><pubDate>Tue, 09 Sep 2008 22:15:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8937269</guid><dc:creator>Greg Young</dc:creator><description>&lt;p&gt;@Alexnaldo Santos:&lt;/p&gt;
&lt;p&gt;What you describe there seems to get rid of all the benefits of having typed objects in the first place (like type safety).&lt;/p&gt;
&lt;p&gt;Also why would your &amp;quot;poco&amp;quot; objects know how to undo themselves? This sounds like a responsibility that should be elsewhere. Generally if I am doing this type of action I explicitly model my state transitions as commands which allows this to happen easily.&lt;/p&gt;
&lt;p&gt;On the original topic, one of the most interesting bits of this for me would be in detaching an object from the current context and how that story would work.&lt;/p&gt;
&lt;p&gt;I think macsgold has a good concept with allowing explicit registration for tracking, but let's stop calling these things entities and let's allow the registration of an [Aggregate Root] for the tracking of changes. Obviously when viewed as entities with bi-directional relationships etc the work involved with traversal can be quite expensive. The [Aggregate Root] pattern and the preference of uni-directional relationships (object paradigm vs relational paradigm) makes the search space significantly smaller.&lt;/p&gt;
&lt;p&gt;A side note, dynamic proxies are scary for many users and one can quickly get to the &amp;quot;too much magic&amp;quot; point. In an ideal world the dynamic proxying would be transparent but it is unfortunately far from it at this point. Too many people expect (although they are writing terrible code) to be able to do things like if(obj.GetType() == typeof(Customer)) and the dynamic proxies will seriously confuse this type of developer.&lt;/p&gt;
&lt;p&gt;EF here is running into an issue many others have run into. A run-time weave is what would be wanted but the limitations and confusing use of dynamic proxies is a less than transparent solution. There have been many of us who have been asking for a way to run-time instrument IL (other than the profiler API :)) to be built into the CLR. This would allow the run-time weave behavior being sought while maintaining a much better level of transparency to the developer.&lt;/p&gt;
</description></item><item><title>re: Discussion about API changes necessary for POCO:</title><link>http://blogs.msdn.com/efdesign/archive/2008/08/01/discussion-about-api-changes-necessary-for-poco.aspx#9199282</link><pubDate>Fri, 12 Dec 2008 03:28:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9199282</guid><dc:creator>Harvey</dc:creator><description>&lt;p&gt;In a DDD project, there will usually be s service object responsible for persist the domain object to the data store, such as UserSerivice.SaveUser(user) etc. So, why just let the consumer of the EF tell EF to persist the entity, no tracking, no comparison or notification. We just need something like _context.SaveObject(object), _context.DeleteObject(object) or _context.InsertObject(object). It is easy to implement and easy to use.&lt;/p&gt;
</description></item><item><title>re: Discussion about API changes necessary for POCO:</title><link>http://blogs.msdn.com/efdesign/archive/2008/08/01/discussion-about-api-changes-necessary-for-poco.aspx#9270199</link><pubDate>Sat, 03 Jan 2009 12:28:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9270199</guid><dc:creator>Simon Segal</dc:creator><description>&lt;p&gt;I would really love to see the equivalent of &amp;quot;Fetching Strategies&amp;quot; that appear in NHibernate. In following a DDD approach, POCO along with Fetching Strategies would allow me to inject and specify what my loading intentions are, whether they be to eager fetch of lazy load. I could today build some kind of interpreter perhaps that allows my Repository to build a chain of .Includes for eager fetching but lazy loading is currently extremely difficult to accommodate in this respect. Essentially what I would love to see is the ability to create single fetching strategies that embody my loading intentions either eager or lazy. For example in LINQ To SQL I was able to achieve this with eager loading in this fashion:&lt;/p&gt;
&lt;p&gt;public interface IFetchingStrategy&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;/// &amp;lt;summary&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;/// LINQ To SQL DataLoadOptions&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;/// to use on the given DataContext.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;/// &amp;lt;/summary&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;DataLoadOptions LoadOptions { get; }&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;/// &amp;lt;summary&amp;gt;&lt;/p&gt;
&lt;p&gt;/// Marker Interface&lt;/p&gt;
&lt;p&gt;/// &amp;lt;/summary&amp;gt;&lt;/p&gt;
&lt;p&gt;/// &amp;lt;typeparam name=&amp;quot;TRole&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;/// Specification of a role for &lt;/p&gt;
&lt;p&gt;/// dyanmic runtime type lookup.&lt;/p&gt;
&lt;p&gt;/// &amp;lt;/typeparam&amp;gt;&lt;/p&gt;
&lt;p&gt;public interface IFetchingStrategy&amp;lt;TRole&amp;gt; : IFetchingStrategy{ }&lt;/p&gt;
&lt;p&gt;THE IMPLEMENTATION:&lt;/p&gt;
&lt;p&gt;public class CustomerLoyaltyDiscountFetchingStrategy : IFetchingStrategy&amp;lt;ICustomerLoyaltyDiscount&amp;gt;&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;private readonly DataLoadOptions _loadOptions;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;#region IFetchingStrategy&amp;lt;Customer,ICustomerFaxChange&amp;gt; Members&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;/// &amp;lt;summary&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;/// The DataLoadOptions used for&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;/// eager loading.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;/// &amp;lt;/summary&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;public DataLoadOptions LoadOptions&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;get { return _loadOptions; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;#endregion&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;#region Constructor&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;/// &amp;lt;summary&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;/// The constructor which sets the fetching strategies&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;/// eager loading options.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;/// &amp;lt;/summary&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;public CustomerLoyaltyDiscountFetchingStrategy()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;_loadOptions = new DataLoadOptions();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;_loadOptions.LoadWith&amp;lt;Customer&amp;gt;(c =&amp;gt; c.Orders);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;_loadOptions.LoadWith&amp;lt;Order&amp;gt;(o =&amp;gt; o.OrderLines);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;#endregion&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
</description></item><item><title>re: Discussion about API changes necessary for POCO:</title><link>http://blogs.msdn.com/efdesign/archive/2008/08/01/discussion-about-api-changes-necessary-for-poco.aspx#9456629</link><pubDate>Tue, 03 Mar 2009 15:41:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9456629</guid><dc:creator>Tanveer Badar</dc:creator><description>&lt;p&gt;@Q1 and Q2: I think approach 1 of always giving correct results is the correct way to go forward with snapshots. It preserves existing code, provides correct results, seems like a win-win to me.&lt;/p&gt;
&lt;p&gt;@Q3: Throwing an exception is just limiting the user even more. There won't be any choice except try{ } catch(blah b){ } around the whole thing.&lt;/p&gt;
&lt;p&gt;Another approach would be to fail gracefully, populate an Errors collection instead.&lt;/p&gt;
</description></item></channel></rss>