Another requirement in this iteration is to interact with physical devices that comprise a POS terminal, such as opening a cash drawer, dispensing change from the coin dispenser, and capturing a signature from the digital signature device.
The NextGen POS must work with a variety of POS equipment, including that sold by IBM, Epson, NCR, Fujitsu, and so forth.
Fortunately, the software architect has done some investigation, and has discovered that there is now an industry standard, UnifiedPOS (www.nrf-arts.org), that defines standard object-oriented interfaces (in the UML sense) for all common POS devices. Furthermore, there is the JavaPOS (www.javapos.com)—a Java mapping of the UnifiedPOS.
Therefore, in the Software Architecture Document, the architect adds a technical memo to communicate this significant architectural choice:
Technical Memo
|
Figure 33.14 shows some of the interfaces, which have been added as another package of the domain layer in our Design Model.
Assume that the major manufacturers of POS equipment now provide JavaPOS implementations. For example, if we buy an IBM POS terminal with a cash drawer, coin dispenser, and so forth, we can also get Java classes from IBM that implement the JavaPOS interfaces, and that control the physical devices.
Consequently, this part of the architecture is resolved by buying software components, rather than building them. Encouraging the use of existing components is one of the UP best practices. |
How do they work? At a low level, a physical device has a device driver for the underlying operating system. A Java class (for example, one that implements jpos.CashDrawer) uses JNI (Java Native Interface) to make calls out to these device drivers.
These Java classes adapt the low-level device driver to the JavaPOS interfaces, and thus can be characterized as Adapter objects in the GoF pattern sense. They can also be called Proxy objects—local proxies that control or enhance access to the physical devices. It is not uncommon to be able to classify a design in terms of multiple patterns. |
3.138.60.166