What is AggregateCatalog
? What does it mean when you construct a new AggregateCatalog()
? What does it mean when you add assemblies to the catalog, eg catalog.Catalogs.Add(new AssemblyCatalog(someAssembly))
? Other than assemblies what can you add to the catalog? any general knowledge related to this would be helpful, too (I'm a total noob)
The best example of a product catalog is the Amazon marketplace, where you can get a host of information in a single click. Think about a book that you've been trying to buy - Amazon lists all the information that you need.
B2B product catalogs contain important purchasing information such as product codes, names, descriptions, images, unique customer pricing, available quantities, minimum order quantities etc. and offer detailed views for customers to make quick and precise decisions.
What is an Ecommerce Catalog? An online catalog, also known as a digital catalog or B2B ecommerce catalog, is an extensive electronic catalog on a website that showcases all the products you sell and allows buyers to shop and purchase.
AggregateCatalog
in MEF basically allows you to collect multiple extension catalogs. When you call new AggregateCatalog()
, you are basically instantiating a new catalog collection (not necessarily populated) that can contain multiple instances of ComposablePartCatalog, which can contain multiple parts.
Consider it a class that helps you collect parts from multiple sets.
Assemblies are just a way to push parts to the calling application. You can pass parts directly from inside the existing assembly.
For more information about catalogs, I would recommend reading this.
Mef has a small learning curve - go thru the docs at mef.codeplex.com atleast once. Or try screencasts if you're really pressed for time.
The idea is that a catalog is a dictionary of exported parts (objects to be injected) or parts that need imports (that need injected objects).. The catalog can be populated in multiple ways (hence the diff Catalog derivations) -- from a Directory (all asm in a dir) or a Specific assembly.
Next you can create a composite catalog e.g. you want to create a single dictionary that contains all exported objects from DirA and from this specific assembly lying in DirB. In this case, you can create individual catalogs and then a composite catalog which merges the two. Now you consume this merged dictionary in your code to ask for imports/exports.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With