You are on page 1of 16

MANAGER & TECHNICIAN PAIR VALET OBJECTS(COMMAND DESIGN PATTERN)

By TANUJ KATHURIA ORPOS DEVELOPER

Manager & Technician Role


They handle the communication between the resources and Application using valet object which are pass in RMI/JMS. They are used to access the database, in-store legacy system and devices such as scanner, printer, verifone etc. Creation of UI and interaction with backend is done through Manager Technician pair.

INTERACTION B/W MANAGER & TECHNICIAN


APPLICATION MANAGER

RMI/JMS
(VALET OBJECT FOLLOWS COMMAND PATTERN)

RESOURCES PRINTER,SCANNER,DB

TECHNICIAN

MANAGER & TECHNICIAN


POS make a request for a particular resource through an appropriate manager and every manager has a corresponding technician mapped in conduit file. Manager instantiates a valet object and sent it through RMI(The Java Remote Method Invocation (RMI) system allows an object running in one Java virtual machine to invoke methods on an object running in another Java virtual machine)

Continued
The technician allows the command object to access its resources and instructs it to execute . The valet is passed back to the manager with the requested information. Manager handles all the requests from POS to use the resources and they provide the API to POS. Conduit script help in finding the manager/technician pair.

TECHNICIAN
Technicians operate on the resources based on the requests received from the managers. Technicians usually reside on the same machine with the resource to be accessed. Many managers make requests to the same technician.

VALET OBJECT
The command object in the command pattern Contains both data and code to execute Managers pass the Valet Object over RMI to the Technician

Conduit Script
Defines the Bus and all Manager/Technician pairs that will be instantiated in the system Dispatcher reads the conduit script at run time. Conduit script points to the manager and technician top-level configuration files (eg:defaultuicfg.xml), top-level parameter files, database configuration files etc.

IMPORTANT MANAGER/TECHNICIAN PAIRS


Parameter Manager/Technician Pair
Provides the parameters at Corporate, store, register and operator level to customize the application at run time.

User Interface Manager/Technician


Access and manipulate UI components

Data Manager/Technician Pair


to access the data resource and persist data

Continued
Journal Manager/Technician Pair
writes audit information and updates the ejournal table jl_enr in the database

Log Manager/Technician Pair


To place the output in one location in single tier

Device Manager/Technician Pair


To access the hardware devices like Printer,Scanner etc

Parameter Manager/Technician
Site Parameter Xml

Valet Parameter Mgr


RMI/JMS

Parameter Tchn

Command Pattern

PARAMETER MANAGER/TECHNICIAN
Parameters can be changed at run time by a user with appropriates rights. Base implementation makes use of the parameter XML which is read at application startup. A handle to parameter Manager is obtained from the bus. Parameter manager communicates to parameter technician who in turn act on the Parameter XML and do the required action. Parameter XML is defined in the main parameter technician file, application.xml

PARAMETER MANAGER/TECHNICIAN
First step is to get the manager out of the bus which is Parameter Manager in this case. ParameterManager param=(ParameterManager)Bus.getManager() ; Set up a variable to hold the result and make a request to manager. Manager in turn send the request to Technician which is Parameter Technician using RMI valet object.

UI MANAGER TECHNICIAN
User Interface technician is coded to create the entire user interface subsystem by using Swing Java Classes :
UIManager class POSUIManager provides API
showScreen() getModel() setModel()

UI Technician class UITechnician


Implements UI based on UI subsystem

UI Configuration Scripts
defaultuicfg.xml commonuicfg.xml One uicfg.xml per tour

Continued
Prepare data and show the screen: Public void arrive (BusIfc bus) { POSUIManagerIfc ui = (POSUIManagerIfc) bus.getManager(UIManagerIfc.TYPE); model = new POSBaseBeanModel(); ui.showscreen(POSUIManagerIfc.SCREEN_NAME, model); }

COMMAND PATTERN
Command pattern is a data driven design pattern and falls under behavioral pattern category. A request is wrapped under a object as command and passed to invoker object. Invoker object looks for the appropriate object which can handle this command and pass the command to the corresponding object and that object executes the command.

You might also like