{"action":"created","issue":{"url":"https://api.github.com/repos/tonysneed/trackable-entities/issues/26","labels_url":"https://api.github.com/repos/tonysneed/trackable-entities/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/tonysneed/trackable-entities/issues/26/comments","events_url":"https://api.github.com/repos/tonysneed/trackable-entities/issues/26/events","html_url":"https://github.com/tonysneed/trackable-entities/pull/26","id":54761416,"number":26,"title":"New interface IIdentifiable, new base class EntityBase","user":{"login":"azabluda","id":7567733,"avatar_url":"https://avatars.githubusercontent.com/u/7567733?v=3","gravatar_id":"","url":"https://api.github.com/users/azabluda","html_url":"https://github.com/azabluda","followers_url":"https://api.github.com/users/azabluda/followers","following_url":"https://api.github.com/users/azabluda/following{/other_user}","gists_url":"https://api.github.com/users/azabluda/gists{/gist_id}","starred_url":"https://api.github.com/users/azabluda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azabluda/subscriptions","organizations_url":"https://api.github.com/users/azabluda/orgs","repos_url":"https://api.github.com/users/azabluda/repos","events_url":"https://api.github.com/users/azabluda/events{/privacy}","received_events_url":"https://api.github.com/users/azabluda/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-01-19T13:06:28Z","updated_at":"2015-02-04T14:51:59Z","closed_at":"2015-01-30T16:12:39Z","pull_request":{"url":"https://api.github.com/repos/tonysneed/trackable-entities/pulls/26","html_url":"https://github.com/tonysneed/trackable-entities/pull/26","diff_url":"https://github.com/tonysneed/trackable-entities/pull/26.diff","patch_url":"https://github.com/tonysneed/trackable-entities/pull/26.patch"},"body":"This work item addresses the topics raised in http://trackable.codeplex.com/discussions/552553#PostContent_1278793 and http://trackable.codeplex.com/discussions/552553#PostDetailsCell_1278860 as well as in https://trackable.codeplex.com/workitem/35. Has some relationships to #25.\r\n\r\nThe new interface [IIdentifiable](https://github.com/azabluda/TrackableEntitiesContrib/commit/3cdacbf40de260ed0f97b46a74641d58b64129cd#diff-37b3de12097db9ebc79503f900a9d92bR11) replaces the runtime check https://github.com/azabluda/TrackableEntitiesContrib/commit/3cdacbf40de260ed0f97b46a74641d58b64129cd#diff-fe5e39db73ce5772fb11de64be375c1eL54 with a generic constraint https://github.com/azabluda/TrackableEntitiesContrib/commit/3cdacbf40de260ed0f97b46a74641d58b64129cd#diff-fe5e39db73ce5772fb11de64be375c1eL54 in function MergeChanges.\r\n\r\nFor backward compatibility I provide a rudimentary implementation of IIdentifiable in ModelBase class (see dfb9ad6). It is neither efficient nor elegant, but essentially just repeats what we always did in the past. I couldn't drop the class entirely or change it any more significantly, because there may still be guys using it in their projects and relying on its specific behavior. Deprecation of ModelBase (should it ever take place) must be more carefully planned and communicated to the users, I believe.\r\n\r\nMy suggestion for all new TE-based projects is to use the new [EntityBase](https://github.com/azabluda/TrackableEntitiesContrib/blob/e7454fd0fee9876a9e897039c89ab1ad918a4830/Source/TrackableEntities.Client/EntityBase.cs) class which is cleaner, safer and faster due to less private reflection magic. Furthermore EntityBase is non-generic, and thus is less biased towards the root of the entity hierarchy, making the model look somewhat more natural to my taste. Actual entities derived from EntityBase look substantially cleaner: no more unnecessary implementation of IEquatable<T> repeated in every class and subclass, no duplicate implementations of ITrackable, etc. One can just have a look at the commit stats for fb80619f2263d1183c93304da21369c0babfc1a2\r\n>  23 changed files  with 124 additions and *462 deletions*.\r\n\r\nOpen questions:\r\n\r\n1. In fb80619f2263d1183c93304da21369c0babfc1a2 I switched all unit test entities from ModelBase to EntityBase, which effectively reduced the test coverage for ModelBase down to zero. We can of course skip this commit, but then EntityBase remains uncovered. Dilemma... Do you have an idea how to proceed?\r\n2. T4 templates must be updated for cleaner output based on class EntityBase. @tonysneed may I count on your support here?\r\n3. EntityBase overrides Equals/GetHashCode methods, which may cause certain unexpected behavior for those guys who store their entities in HashSets or Dictionaries and one day dare to regenerate classes with the new template. Class [ObjectReferenceEqualityComparer](https://github.com/azabluda/TrackableEntitiesContrib/blob/6cf6ceb37bebbfaecb1e1a6741df468ec262974b/Source/TrackableEntities.Common/ObjectReferenceEqualityComparer.cs) gives a clear answer how to preserve the old behavior, but I guess it must at least be mentioned in the release notes.\r\n\r\nRegards,\r\n@azabluda"},"comment":{"url":"https://api.github.com/repos/tonysneed/trackable-entities/issues/comments/72867121","html_url":"https://github.com/tonysneed/trackable-entities/pull/26#issuecomment-72867121","issue_url":"https://api.github.com/repos/tonysneed/trackable-entities/issues/26","id":72867121,"user":{"login":"tonysneed","id":2836367,"avatar_url":"https://avatars.githubusercontent.com/u/2836367?v=3","gravatar_id":"","url":"https://api.github.com/users/tonysneed","html_url":"https://github.com/tonysneed","followers_url":"https://api.github.com/users/tonysneed/followers","following_url":"https://api.github.com/users/tonysneed/following{/other_user}","gists_url":"https://api.github.com/users/tonysneed/gists{/gist_id}","starred_url":"https://api.github.com/users/tonysneed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonysneed/subscriptions","organizations_url":"https://api.github.com/users/tonysneed/orgs","repos_url":"https://api.github.com/users/tonysneed/repos","events_url":"https://api.github.com/users/tonysneed/events{/privacy}","received_events_url":"https://api.github.com/users/tonysneed/received_events","type":"User","site_admin":false},"created_at":"2015-02-04T14:51:59Z","updated_at":"2015-02-04T14:51:59Z","body":"@azabluda Is there anything else we need to do to support inheritance? Or does this PR cover it?"}}