HowTos - Application Architecture: Common

Set default Databasket for SalesPoints

Description:
This is required if processes executed on a SalesPoint are to run in a specific transactional context. The specified DataBasket will be attached to every process running on the SalesPoint and will determine its transactional context. By default, no DataBasket is attached to a SalesPoint so that processes run outside any transactional context.

Used classes:

Related topics:

ToDo:
This can be achieved in several ways. In any case, you need to attach the DataBasket to the SalesPoint:

  1. a. Open the designated Shop class.
    b. Override the protected void onSalesPointAdded() method according to your needs.
  2. a. Open the designated SalesPoint class.
    b. Attach the DataBasket in it's constructor.

Example Source Code:


1 a
public class ArchitectureShop extends Shop
{
    .
    .
    .
    1 b
    protected void onSalesPointAdded(SalesPoint sp) {
        super.onSalesPointAdded(sp);
        sp.attach(new DataBasketImpl());
    }
			
}
		

2 a
public class ArchitectureSalesPoint extends SalesPoint
{
    .
    .
    .
    2 b
    public ArchitectureSalesPoint(String sPointName, DataBasket db) {
        super(sPointName);
        attach(db);
    }
			
}
		

Back to:


previous Application Architecture: PersistenceData Management: Catalog next



by Thomas Ryssel