inventory.tex 2.5 KB

1234567891011121314151617181920212223242526272829
  1. \section{Inventory}
  2. \label{sec:inventory}
  3. \begin{figure}[ht]
  4. \centering
  5. \includegraphics[width=1.0\textwidth]{images/Inventory_Overview.eps}
  6. \label{inventory_overview}
  7. \caption{Inventory - Class Overview}
  8. \end{figure}
  9. An inventory is a place, where products are stored.
  10. In \salespoint{}, an abstract representation if the \code{Inventory} interface and its implementing class \code{PersistentInventory}.
  11. The interface and declares methods to add, remove and find products.
  12. Because an inventory contains specific product instances, \code{PersistentInventory} aggregates \code{PersistentProductInstance}s.
  13. \code{PersistentProductInstance}s can be retrieved from \code{PersistentInventory} by specifying a \code{SerialNumber} or a \code{ProductIdentifier}.
  14. A \code{SerialNumber} is used to reference a specific \code{ProductInstance}.
  15. A \code{ProductIdentifier} identifies a \code{Product} uniquely, thus all \code{PersistentProductInstance}s of the \code{PersistentProduct} specified by the supplied \code{ProductIdentifier} are returned.
  16. Additionally an \code{Iterable<ProductFeature>} can be supplied to the \code{find()}-method along with a \code{ProductIdentifier} to retrieve all instances of a product, where the \code{ProductFeature}s match exactly those specified.
  17. Matching a set of \code{ProductFeatures} against a \code{PersistentProductInstance} is hard to express in JPQL or Criteria Queries (see Section \ref{sec:jpa}).
  18. Therefore, only the \code{ProductIdentifier} is used to build a Criteria Query, which is executed on the database.
  19. Selecting only those \code{PersistentProductInstances} which match the specified \code{ProductFeature}s is done in Java code.
  20. %\code{Inventory} aggregates \code{Product}s, \code{PersistentInventory} aggregates \code{PersistentProduct}s
  21. %A shop must store products in an inventory, because the customer should get your good on order very quickly. If there are no amount of this product inside, it must be ordered by its producer.
  22. %This procedure can be implemented by the \code{PersistentInventory}-class. This class is an implementation of the interface \code{Inventory}, to used its functionality and also
  23. %to persist the items of your inventory.\\
  24. %With the methods of the \code{Inventory}-class you can add one or many \code{Products} to the inventory, you can remove a product from it or you can checked, whether a product exist in it.
  25. %Also you can find \code{Products} with several options, if you know the \code{ProductIdentifier}, their \code{productFeatures} or the classes of them.