X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=results.itasks.tex;h=f7358a9e9e8a6674794c77bcb989f74d343ef121;hb=514965291a1999329cab3dd5f846a0ecce72cec7;hp=a3ecffaca5d8053375cfff6d3408d0d9943b831c;hpb=b8e0188d0d4b4f321259e036807b439c85753828;p=msc-thesis1617.git diff --git a/results.itasks.tex b/results.itasks.tex index a3ecffa..f7358a9 100644 --- a/results.itasks.tex +++ b/results.itasks.tex @@ -1,8 +1,8 @@ -The server side of the system is written in \gls{iTasks}. Functions for managing -devices, \glspl{Task} and \glspl{SDS} have been created to support the -functionality. An interactive application has been created that -allows an interactive management console for the \gls{mTask} system. This -interface provides functionality to list \glspl{SDS}, add \glspl{Task}, remove +The server side of the system is written in \gls{iTasks}. Functions for +managing devices, \glspl{Task} and \glspl{SDS} have been created to support the +functionality. An interactive application has been created that allows an +interactive management console for the \gls{mTask} system. This interface +provides functionality to list \glspl{SDS}, add \glspl{Task}, remove \glspl{Task}, administrate devices and view the state of the system. \section{Integration} @@ -39,33 +39,43 @@ a device after a restart of the server application. \end{figure} \section{Shares} -The architecture of the system stores the \glspl{SDS} in the \gls{SDS} that -stores the list of devices. This means that if a \gls{SDS} updates, everyone -watching it will be notified. This would result in to a lot of notifications -that are not ment to be for the listener. Moreover, when a client updates the -\gls{SDS} this is processed by the connection handler and results in an update -of the real \gls{SDS}. When an \gls{iTasks}-\gls{Task} writes to a \gls{SDS} -this is not passed on to the device. - -To solve the problem, parametric lenses are used on the device storage. -Listing~\ref{lst:actualdev} shows the actual types for the device storage. -Programmers wanting to access the entire \gls{SDS} use the \CI{deviceStoreNP}. -Programmers wanting to access a single \gls{SDS} on a device can use the -\CI{getRealShare} function which is a wrapper around the \CI{deviceStore} which -applies a parametric lens to the \gls{SDS}. +The architecture of the system needs to keep track of the \glspl{SDS} stored on +the client. \glspl{SDS} can be stored on only one device at the same time. +that also stores the of devices. This means that if a \gls{SDS} updates, +everyone watching it will be notified. This would result in to a lot of +notifications that are not ment to be for the listener. Moreover, when a client +updates the \gls{SDS} this is processed by the connection handler and results +in an update of the real \gls{SDS}. +Finally, the \gls{SDS} of a client must be synchronized with the actual device. +There are several ways of tackling this problem each with their own pros and +cons and their own level of abstraction. + +\begin{itemize} + \item Instantiate an actual \gls{iTasks}-\gls{SDS} for every \gls{SDS} used + in a client. + + + \item Instantiate a \gls{iTasks}-\gls{SDS} for every device that stores all + their \glspl{SDS}. + + \item Use only one \gls{iTasks}-\gls{SDS} for all devices. +\end{itemize} \begin{lstlisting}[label={lst:actualdev},% caption={Real types for the device \gls{SDS}}] deviceStoreNP :: Shared [MTaskDevice] deviceStore :: RWShared (Maybe (MTaskDevice, Int)) [MTaskDevice] [MTaskDevice] - -realDeviceStore :: Shared [MTaskDevice] - -getRealShare :: MTaskDevice MTaskShare -> Shared BCValue \end{lstlisting} \subsection{Parametric Lens} -The type of the parametric lens is \CI{Maybe (MTaskDevice, Int)} where the +The type of the parametric lens is \CI{Maybe (MTaskDevice, Int)}. The \gls{SDS} +can either be focussed on the entire share, from now on global. Moreover, the +\gls{SDS} can focus on a single device, from now on local. A local \gls{SDS} +can also specifically focus on a single \gls{SDS} on a single device. + +The implementation for the share is shown in Listing~\ref{lst:shareimpl}. The +\CI{realDeviceStore} \gls{SDS} is not exported through the header files. This +\gls{SDS} contains the actual \gls{SDS} that writes to disk or memory. \CI{Int} is the identifier of the \gls{SDS}. The \gls{iTasks} way of applying lenses is through the \CI{sdsFocus} function and through the \CI{sdsLens} functions. \CI{sdsFocus} allows the programmer to fix the parameter.