Business Logic Layer

From Znode Knowledge Base
Jump to: navigation, search

Znode uses a multi-tier Business Logic Layer (BLL) that has been organized to allow developers to easily extend the eCommerce functionality available out of the box.

  • The BLL does not include any database access functionality. You must avoid adding any data access functions and use the DAL instead to retrieve data
  • Modifying certain areas of the BLL could affect PCI compliance. You should refer to the PCI Compliance Guide included with Znode before making any changes.

Znode Business Logic Layer

The BLL in Znode includes 16 different C# libraries that can be modified and deployed independently.

Detail Description
ZNode.Libraries.ECommerce.Entities Library defines classes for Product, SKU and Add-Ons.
ZNode.Libraries.ECommerce.Fulfillment Library takes care of Order fulfillment.
ZNode.Libraries.ECommerce.ShoppingCart Library contains the implementation and management of the shopping cart.
ZNode.Libraries.ECommerce.Utilities Library contains services which are used for common operations. Ex:Sending mail
Znode.Libraries.MediaStorage Library contains services for managing media in different providers like local storage Amazon and Azure.
ZNode.Libraries.Search Library contains services for managing search operations. Znode 9x contains the new Elastic Search search engine.
Znode.Engine.Promotions Library contains services to handle coupon and promotion based discount calculations.
Znode.Engine.Shipping Library encapsulates the shipping engine that calculates shipping rates for different providers like FedEx, UPS, USPS and "Custom".
Znode.Engine.Tasks Library contains implementation of task schedulers
Znode.Engine.Taxes Library contains services to handles tax calculations.
Znode.Engine.ERPConfigurator Library contains services for importing data from other ERP system.
Znode.Engine.ERPTaskScheduler Library contains services for scheduling data importing at specific time.
Znode.Engine.ImageHelper Library contains services for managing images
Znode.Engine.SearchIndexer Library contains services for calling the search library.
ZNode.Libraries.Resources Library contains resources files which is commonly used in all applications

View of the Znode BLL Libraries

MFBLL.png

Extending the Znode BLL

The Business Logic Layer can be easily extended. New library DLLs can be copied to a production server without redeploying the entire application. Furthermore, you can add new functionality to the Shipping, Supplier, Tax, and Promotion libraries and configure them to be available as options in the storefront Site Admin. For example, you may want to add a new Promotion that calculates 10% off orders on the 3rd day of every month. To do this you just need to do the following:

  1. Create a new class derived from ZNodePromotionRule (in this case you could start with the ZnodeCartPromotionAmountOffOrder.cs class as an example).
  2. Compile and run your application.
  3. Next, go into the Storefront site admin and choose “MARKETING” from the hamburger menu. Select “PROMOTIONS AND COUPONS”.
  4. Then, click on "Add New Promotion Rule Type" and fill out the form (again use ZnodeCartPromotionAmountOffOrder.cs as an example of how to fill this in).
  5. Now your new function will show up in the Select Discount Type drop down when you add a new “Promotion Rule”.


The same procedure will be used for extending the Shipping, Supplier and Tax libraries.


Related Links