Boite à outils Office

Don’t forget the ProductConfiguration / CategoryConfiguration in your Commerce Server development

Commerce Server, Development 3 Comments »

These last few weeks, I have been involved with several Commerce Server reviews, and I have noticed that a lot of CS implementations was done without 2 important settings, which are:

These two classes inherit from Microsoft.CommerceServer.Catalog.CatalogItemConfiguration, and they are used to load only the objects you use. Why? Because when you want to display the product price or its description for example, you do not need to get its ancestors, variants, related products so you can have a simple and lighter Product or Category

Besides, if you have a look into the API via Reflector, you will see that the CategoryConfiguration or ProductConfiguration class is always instantiate if you’re not setting up one (ie, the CS framework choose for you the objects to populate):

image image

To demonstrate to importance of those classes, let’s go through a simple exemple of product implementation where you only need to show the productID, the price and the display name:

  • Without a ProductConfiguration, we use:
Product product = catalogCtx.GetProduct("Adventure Works Catalog", "AW029-03");
Console.WriteLine("Pid: " + product.ProductId
                + " - " + product.DisplayName
                + " - " + product.ListPrice);

With the SQL Profil we are able to get the SQL calls and discover that 2 stored procedures are call:

image 

Read the rest of this entry »

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in
Creative Commons License