Arno Garrels a écrit :
>>In fact, the pattern would be to have your accounts manager ignoring
>>everything on how to store itself and having some classes that "connect"
>>to it, knowing how to handle it to store and/or retrieve its data.
>>
>>not sure to have been clear enough, but... ;)
>
>
> So I guess the Reader/Writer should provide events, something like
> OnReadStart,
> OnReadGroup, OnReadAccount.. right?
Yes...
The idea would be to create methods and events which are mandatory for
such readers/writers. After a quick thought i would suggest :
constructor .Create(UserAccountCollection);
method .Write;
Event .OnBeginWrite(Self);
Loop
Event .OnWriteItem(Self, CollectionItem);
Event .OnEndWrite(Self);
For Read, the problem is that when reading, you cannot know in advance
what/how you are reading (hence there can't be any ReadItem), so i would
suggest :
method .Read;
Event .OnBeginRead(Self);
Event .OnRead(Self);
method .EndRead;
Event .OnEndRead(Self);
i would even suggest that the OnEndRead event is triggered whenever the
developper uses the EndRead method (like the Finish method used in
Midware ServerObjects). it would permit to use some async socket within
the OnRead Event...
HTH,
--
Guillaume MAISON - [EMAIL PROTECTED]
83, Cours Victor Hugo
47000 AGEN
Tél : 05 53 87 91 48 - Fax : 05 53 68 73 50
e-mail : [EMAIL PROTECTED] - Web : http://nauteus.com
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be