Re: OODesign - OPF, design pattern



The easiest (but not accurate) way to explain is something like this

01: Have a singleton, or your app has a reference to a specific object
instance, say "Screen".
02: When the app layer needs input from the user they set Screen.Parameters
03: Setting this will trigger an event notifying the app that
Screen.Parameters has changed
04: The app then uses a factory to find a GUI control that edits the object
type in Screen.Parameters, e.g. AuthenticateUserParameters would create an
AuthenticateUserControl
05: The app then presents this to the user

When the values in the GUI change they update the properties of
(Screen.Parameters as AuthenticateUserParameters).



That's the "task" approach that I play with sometimes (see Onion on my blog)
but my current app I am just quickly throwing something together rather than
working with some kind of framework. So I'll have something like this


public void AddNewViewAngle(int angle);
public void ImageInfo[] GetImagesForViewAngle(int angle);

Where ImageInfo is just a kind of proxy class that holds something like
01: A unique ID identifying the real business object
02: The file name of the image

I can then have events on my app layer that are triggered for example when
the user calls UpdateImageInfo(ImageInfo image), adds an image, or removes
an image.


Pete


.