[CSHARP-584] Improve the design of the convention system for automapping BsonClassMaps Created: 29/Sep/12 Updated: 20/Mar/14 Resolved: 19/Dec/12 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | 1.7, 2.0 |
| Fix Version/s: | 1.8 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Robert Stam | Assignee: | Craig Wilson |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Backwards Compatibility: | Minor Change | ||||||||||||||||
| Description |
|
In 1.6, the design of the convention system for automapping BsonClassMaps is fixed and can't be extended. For 2.0, we are redesigning the convention system to be much more flexible and extensible. See the following new interfaces and classes for details: IConvention ConventionPack The general idea is that ConventionPacks are registered with a filter lambda that determines which types the ConventionPack applies to. When it comes time to AutoMap a class, all the matching ConventionPacks from the registry are combined to produce an effective ConventionPack for that class. The effective ConventionPack may include multiple conventions for the same thing (if more than one matched), but the last one added is the last one to run and wins. If you wish to write your own custom conventions, you would implement one or more of the convention interfaces: IClassMapConvention, IMemberMapConvention and IPostProcessingConvention, put them in a ConventionPack and register the pack. AutoMap runs all the IClassMapConventions first, then all the IMemberMapConventions (on whatever members were added to the class map during the first phase), and finally all IPostProcessingConventions to do any final processing of the class map. This change has no effect on the attribute based configuration of class maps or the fluent interface used to configure class maps via code.. However, it will be backwards breaking for 2 groups of people. |
| Comments |
| Comment by auto [ 24/Dec/12 ] |
|
Author: {u'date': u'2012-12-24T23:09:31Z', u'email': u'craiggwilson@gmail.com', u'name': u'Craig Wilson'}Message: |
| Comment by Craig Wilson [ 19/Dec/12 ] |
|
In code review. |
| Comment by Robert Stam [ 29/Nov/12 ] |
|
Reopened to backport to 1.8. For 1.8 the existing convention classes will be deprecated, but will still be supported by some form of interoperation with the new architecture. |
| Comment by auto [ 09/Oct/12 ] |
|
Author: {u'date': u'2012-10-08T14:13:59-07:00', u'email': u'craiggwilson@gmail.com', u'name': u'Craig Wilson'}Message: |
| Comment by auto [ 09/Oct/12 ] |
|
Author: {u'date': u'2012-10-05T08:26:28-07:00', u'email': u'craiggwilson@gmail.com', u'name': u'Craig Wilson'}Message: |
| Comment by auto [ 05/Oct/12 ] |
|
Author: {u'date': u'2012-10-05T06:03:28-07:00', u'email': u'craiggwilson@gmail.com', u'name': u'Craig Wilson'}Message: |
| Comment by auto [ 05/Oct/12 ] |
|
Author: {u'date': u'2012-10-05T05:56:04-07:00', u'email': u'craiggwilson@gmail.com', u'name': u'Craig Wilson'}Message: |
| Comment by auto [ 05/Oct/12 ] |
|
Author: {u'date': u'2012-10-05T05:54:19-07:00', u'email': u'craiggwilson@gmail.com', u'name': u'Craig Wilson'}Message: |
| Comment by auto [ 05/Oct/12 ] |
|
Author: {u'date': u'2012-10-01T19:08:36-07:00', u'email': u'robert@10gen.com', u'name': u'rstam'}Message: |
| Comment by auto [ 01/Oct/12 ] |
|
Author: {u'date': u'2012-09-30T20:01:21-07:00', u'email': u'robert@10gen.com', u'name': u'rstam'}Message: |
| Comment by auto [ 30/Sep/12 ] |
|
Author: {u'date': u'2012-09-29T20:21:11-07:00', u'email': u'robert@10gen.com', u'name': u'rstam'}Message: |