| Change Set |
Date |
Downloads |
Comment |
30766
by
haveriss
|
Apr 7 at
2:55 AM
|
354 |
MEF Preview 5 Release Notes:
Namespace changes - System.ComponentModel.Composition – For part authors. This namespace contains the import and export attributes as well as other APIs that part authors are likely to use. - System.ComponentModel.Composition.Hosting – For hosters. This namespace contains the CompositionContainer, catalog implementations, and other APIs that hosters are likely to use.
Part discovery changes - CompositionOptionsAttribute and DiscoveryMode have been removed. - PartNotDiscoverableAttribute replaces [CompositionOptions(DiscoveryMode = DiscoveryMode.Never)] - PartCreationPolicyAttribute can be used to specify part creation policy (Replaces CompositionOptionsAttribute.CreationPolicy) - By default, exports on a base class will not be included in the exports for a derived class. - The PartExportsInheritedAttribute can be applied to a base class to specify that exports on that class will be included in derived classes WARNING: If this attribute is used, and both the base and derived class have export attributes applied to them, there will be multiple exports created for the same class. Also note that whatever metadata is applied to the export on the base class can’t be added to or overridden by the derived class
Collection imports - ImportManyAttribute should now be used on collection imports (in the future, an ImportAttribute will not be interpreted as a collection import even if it is applied to a collection type). - Array imports are now supported.
Typed Imports/Exports - Imports and Exports now match on type as well as contract. - Exporters of string contracts such as [Export(“Foo”)] must now specify the type they expect to be imported as well. e.g. [Export(“Foo”, typeof(string))]
Method exports - Method exports can now be imported as custom delegates in addition to Action<…> and Func<…> delegates
Directory Catalog - The directory watching functionality has been removed. The Refresh() method has been added to explicitly update the catalog with new assemblies in the directory.
Removal of Caching / new infrastructure - The old caching infrastructure has been removed. We’ve added a general purpose API that allows the implementation of catalog caching as well as supporting builders of custom programming models. The APIs are members of the static class System.ComponentModel.Composition.ReflectionModel.ReflectionModelServices. In the future we plan to ship a sample that shows how these APIs can be used to create cached catalogs.
New sample application - MEF Studio – a designer hosting sample.
Common compilation errors to expect when migrating previous code bases - System.ComponentModel.Composition.Container does not exist -> Add reference to System.ComponentModel.Composition.Hosting namespace - CompositionContainer does not contain method AddPart or Compose -> Need to start using CompositionBatch, or one of the helper extension methods ComposeParts or ComposeExportedObjects - CompositionOptionsAttribute does not exist -> For CreationPolicy use PartCreationPolicyAttribute - INotifyImportCompleted does not exist -> Use IPartImportsSatisfiedNotification interface and change method from ImportCompleted to OnImportsSatisfied
|
28358
by
haveriss
|
Feb 3 at
1:12 AM
|
388 |
Renamed sample to MefShapes |
28355
by
haveriss
|
Feb 3 at
12:30 AM
|
44 |
Renamed sample to MefShapes |
28352
by
haveriss
|
Feb 3 at
12:01 AM
|
34 |
Renamed sample to MefShapes |
28080
by
haveriss
|
Jan 27 at
8:45 PM
|
91 |
Removed keys as we are exposing an unsigned assembly. |
28055
by
haveriss
|
Jan 27 at
12:26 AM
|
75 |
Preview 4 Release notes: Summary of the breaking changes: • AllowNonPublicCompositionAttribute was removed. It is no longer needed MEF will always look at publics and non-publics. • ComposablePartCatalog and related types were moved from System.ComponentModel.Composition to System.ComponentModel.Compositioni.Primitives. • AttributedTypesPartCatalog was renamed to TypeCatalog • AttributedAssemblyPartCatalog was renamed to AssemblyCatalog • DirectoryPartCatalog was renamed to DirectoryCatalog • AggregatingComposablePartCatalog was renamed to AggregateCatalog • Catalog Caching extensibility API’s have been made internal.
New features:
Diagnostics and debugging
We’ve made significant improvements in the debugging experience to address some problematic scenarios and deliver a foundation for diagnostics in all MEF features and extensions.
The differences to note are:
1. Multiple composition errors are structured in numbered groups each relating to a single root cause 2. The ‘causal chain’ (Resulting in: …) traces an issue all the way back to the root action that the application was trying to perform 3. The ‘origin path’ (Element: …) describes how each object involved in the scenario came to be in the composition in the first place 4. All of this information can be retrieved programmatically from the exception types if necessary
Another difference will be the visualization of exceptions when they occur.
Lifetime Management and Creation Policy
• We’ve renamed Singleton and Factory creation policy to Shared / NonShared • Parts and Imports can now both declare creation policy. We’ve also added a new policy called Any, which allows a Part or an Import declare that it can work with either policy, i.e. a Part could have a policy of Any, where one importer of the part’s exports has a policy of NonShared, while another importer has a policy of Shared. The grid below indicates the behavior in different scenarios. • Parts can now be explicitly released from the container by using the Container.ReleaseExport method. This method takes the export and traverses all its references that are non-shared and disposes of them if they implement IDisposable. This prevents what we call viral disposability where every part in the chain must implement IDisposable in order for the deepest child to be disposed. This is an extremely difficult problem for you to manage, and without this feature the likelihood of memory leaks is high. • A Non-shared part that has a recomposable import will be held conditionally based on the lifetime of its exports. If the exports are collected the part will be released as well.
|
28054
by
haveriss
|
Jan 27 at
12:16 AM
|
36 |
Moved preview 3 code from root to preview 3 folder |
28053
by
haveriss
|
Jan 27 at
12:04 AM
|
39 |
Added tags and preview folders
|
26383
by
gblock
|
Nov 25 2008 at
6:55 PM
|
390 |
MEF Preview 3 1. Container has been refactored 2. Value Resolver migrated to new Export Provider 3. Perf enchancements 4. Catalog Caching 5. Unit Tests |
1-9 of 9Change Sets
< Previous 1 Next >
|
|
|
|