diff --git a/report.tex b/report.tex index baa107f..7970beb 100644 --- a/report.tex +++ b/report.tex @@ -496,7 +496,7 @@ format. enclosed fields are simply used in a composition relationship. \end{description} -\subsection{TBD Decorator Pattern} +\subsection{Decorator Pattern} Decorator pattern lets you dynamically change the behaviour of an object at run time by wrapping them in an object of a decorator class. \textit{Pattern4J} found two instances of the decorator patter, @@ -556,8 +556,18 @@ so thats why we have a misclassification signalling the decorator pattern and no it is used in \textbf{writeObject, writeTree, copyCurrentEvent, copyCurrentStructure} methods to signal if delegate the function call to the delegator or to the super class. \end{description} -\subsection{TBD Bridge Pattern} -TBD +\subsection{Bridge Pattern} +\textit{Pattern4J} found one instance of the bridge pattern. +The bridge pattern emphasises composition rather than inheritance. +Implementation details are moved from one hierarchy to another with separate hierarchies of objects. +Looking on the context of the library that is intended to be used as a core for a JSON parser +and by looking at the class implemented it make even more sense. +The class detected is \textbf{json.JsonGeneratorImpl} and the class used is \textbf{io.CharacterEscapes}. +The \textbf{io.CharacterEscapes} class define the escape character used in the file +and is particularly relevant to have this abstraction because there are different standards for string escaping on different systems. +For example on unix systems the escape sequence is ``\textbackslash n'', +where on Microsoft operating systems the escape sequence is ``\textbackslash r\textbackslash n'' +and on IBM mainframe systems the escape sequence is ``\textbackslash 025''. \section{Behavioral Patterns}