\section{Catalog}
\label{sec:catalog}

\begin{figure}[ht]
	\centering
  \includegraphics[width=1.0\textwidth]{images/Catalog_Overview.eps}
	\label{catalog_overview}
	\caption{Catalog - Class Overview}
\end{figure}

The \code{Catalog} interface was designed to manage \code{Product}s and \code{ProductFeature}s in the system.
It provides functionality to add, remove, and find \code{Product}s.
\code{Product}s can be searched by their name or category.
\code{Product}s and \code{ProductFeature}s are more closely described in Section \ref{sec:product}.

The \code{PersistentCatalog} is an implementation of the \code{Catalog} interface.
Additionally \code{PersistentCatalog} provides an \code{update()}-method to update and merge existing \code{PersistentProduct}s to the database.\footnote{\code{update()} to the interface. Misuse \code{add()} for updates? this seems inconsistent.}

The \code{find()} methods request the database in the form of \code{CriteriaQuerys} which will be processed by JPA and results are returned in the form of \code{Iterables}. The reason for this is to make returned objects immutable without making it difficult to iterate over these results. 




%If you want to sell your products at your shop, you must presenting them very good to stimulate customers interests. A helpful solution to giving this people a clearly overview could be
%a catalog. With the \code{PersistentCatalog}-class, you can implemented such a thing. This class is an implementation of the interface \code{Catalog}.\\
%After you created a new catalog, you can add \code{ProductTypes} to it or remove them from it. Also you can checked, whether the catalog contains a defined \code{ProductType}. Aside from you 
%this class provides methods to find productTypes by their name or their category at your catalog.\\
%In case you have added a \code{ProductType} to the catalog and now you are changing this type, you do not need remove the old type from this catalog and add the new to it. Only you need to 
%used the method \code{update(PersistentProductType productType)} from the \code{PersistentCatalog}-class and this \code{productType} will be updated and persist to the \code{PersistentCatalog} 
%and the Database.

