Re: OODesign - OPF, design pattern
- From: "Peter Morris" <support@xxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 28 Aug 2007 10:33:18 +0100
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
.
- Follow-Ups:
- Re: OODesign - OPF, design pattern
- From: Aleksander Oven
- Re: OODesign - OPF, design pattern
- References:
- OODesign - OPF, design pattern
- From: Alan T
- Re: OODesign - OPF, design pattern
- From: Peter Morris
- Re: OODesign - OPF, design pattern
- From: Alan T
- OODesign - OPF, design pattern
- Prev by Date: Re: A very good blog about the Delphi 2007 Help Issue
- Next by Date: Re: I have seen some fat client Dot Net apps
- Previous by thread: Re: OODesign - OPF, design pattern
- Next by thread: Re: OODesign - OPF, design pattern
- Index(es):