accountancy.tex 2.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. \section{Accountancy}
  2. \label{sec:accountancy}
  3. The accountancy package contains functionality supporting book keeping.
  4. \code{AccountancyEntry} is a representation of an accounting entry.
  5. \code{Accountancy} aggregates \code{AccountancyEntry}s.
  6. Every \code{AccountancyEntry} is uniquely identified by an \code{AccountancyEntryIdentifier}.
  7. \\
  8. \code{PersistentAccountancyEntry} implements \code{AccountancyEntry} and serves as persistence entity, while \code{PersistentAccountancy} implements \code{Accountancy} and provides transparent access to the JPA layer.
  9. \code{AccountancyEntryIdentifier} is used as primary key attribute, when entities are stored in the database.
  10. \\
  11. By implementing and sub-classing the \code{AccountancyEntry} interface, the notion of different accounts, as known from double-entry bookkepping, can be realised.
  12. As can be seen in Figure~\ref{accountancy_overview}, \code{PersistentAccountancyEntry} is sub-classed to create a second ``account'' used to store payment information, namely \code{ProductPaymentEntry}.
  13. \begin{figure}
  14. \centering
  15. \includegraphics[width=1.0\textwidth]{images/Accountancy_Overview.eps}
  16. \label{accountancy_overview}
  17. \caption{Accountancy - Class Overview}
  18. \end{figure}
  19. Payment information also includes a user identifier referencing the buyer, an order identifier referring to the \code{Order} which was payed, and a \code{PaymentMethod} describing the money transfer.
  20. The attributes are named \code{userIdentifier}, \code{orderIdentifier}, and \code{paymentMethod} respectively.
  21. The inheritance hierarchy of \code{PaymentMethod} is depicted in Figure \ref{payment_overview}.
  22. \begin{figure}
  23. \centering
  24. \includegraphics[width=0.75\textwidth]{images/Payment_Overview.eps}
  25. \label{payment_overview}
  26. \caption{Payment - Class Overview}
  27. \end{figure}
  28. To create a new account, \code{AccountancyEntry} has to be sub-classed.
  29. Every (persisted) object of such a class belongs to the same account.
  30. Accessing per-account entries is facilitated by specifiying the desired class type when calling \code{get()} or \code{find()} methods of \code{Accountancy} as explained in Section \ref{jpa-types}.