diff --git a/main.tex b/main.tex index 7502e18..15837b1 100644 --- a/main.tex +++ b/main.tex @@ -360,7 +360,7 @@ \item È possibile eseguire normali operazioni di CRUD\cite{wiki:crud} nonchè costruire manualmente query tramite i metodi statici della classe \textit{CRUDUtils}, che lavorano in input e in output con istanze delle - classi ``entità''; + classi ``entità'' registrate nell'ORM; \item Inoltre, è possibile creare nuovi \textit{controller} con facilità ereditando dalle classi astratte \textit{JsonProducer} (per implementare funzioni al di fuori di CRUD), @@ -375,6 +375,43 @@ \textit{ReadableRESTController} e \textit{CRUDRESTController}, complete di Javadoc (in inglese, come presente nei sorgenti originali). \end{it} +\begin{en} + \subsubsection{\textit{restaurant} -- server side} + The \textit{restaurant}\footnote{\textit{restaurant} is a pun on the word + \textsc{REST}} library is imported + as a normal Maven\cite{maven:website} dependency. It requires the + following dependencies: + \begin{description} + \item[Hibernate ORM\cite{hibernate:website}] a famous Java Object/Relation + Mapper\cite{wiki:orm}, used to query the \textit{PostgreSQL} database + with ease; + \item[GSON\cite{gson:website}] a library from Google for serializing and + deserializing Java object in JSON; + \item[Jersey\cite{jersey:website}] an implementation of the API JAX-RS + for creating REST endpoints, not through servlets but using + simple methods contained in plain classes, called \textit{controllers}, + decorated with the annotations contained in the package \texttt{javax.ws.rs}. + \end{description} + + The boilerplate needed to query the database is further simplified by the + code in \textit{restaurant} on two levels: + \begin{itemize} + \item It is possible to perform common CRUD operations\cite{wiki:crud} + and to build and execute custom queries by the static methods accessible + in the \textit{CRUDUtils} class. Those procedures work on the ``entity'' + classes registered in the ORM; + \item In addition to what mentioned above, \textit{controller} can be + implemented with ease inheriting the abstract classes \textit{JsonProducer} (for + non-CRUD operations), \textit{ReadableRESTController} (for read-only CRUD + operations) and \textit{CRUDRESTController} (for complete CRUDs). + These components offer methods able to automatically generate both success + and error JSON responses. + \end{itemize} + + Below there are the interface listings for the classes \textit{CRUDUtils}, \textit{JsonProducer}, + \textit{ReadableRESTController} and \textit{CRUDRESTController}, with the + respective Javadoc comments (in english, as in the original sources). +\end{en} \begin{lstlisting}[caption=Interfaccia della classe \textit{JsonProducer}, label={lst:jsonprd-java}, language=Java] /**