Treating Single objects and lists of objects the same


Yeah I thought of doing it that way but it would mean I would have to create
a list object for every object type.  I guess I was just being lazy I wanted
to try and find a way to only have to declare the properties etc. once.

I was wondering if anybody knows a way I could use Rose to generate the code
for these objects.  I am using the Rose Delphi link at the moment but it
would be great if I could use architectural mechanism to generate the code.
I could then do all the design once (in the architectural mechanisms) and
then apply this mechanism to the objects that require it.  Is there enything
available that can do this or am I being lazy ;-).

If there isn't anything vailable to do this has anybody had axperiance
automating rose.  If I could get to the class properties etc.  I could write
my own code generator.


"Bryan" <> wrote in message

> TCustomUser
>   |            |
>   |            |
> TUser     |
>                |
>               TUserGroup ---------* TUser

> Now make your methods act with TCustomUser, which could be a group or a
> single item.

> Bryan

> "Stephen Young" <> wrote in message
> news:3d53ae6f_2@dnews...
> > Hi,

> > I am lloking into how I could treat single objects and lists of objects
> > the same manner.  Often I call operations that might return a single
> object
> > or multiple objets and I would like to be able to handle both situations
> in
> > a similar way.

> > Idealy I would like to write code like this:

> > file://for single object:
> > User := MyObj.GetOneUser;
> > ShowMessage(User.Name);

> > file://for multiple objects:
> > User := MyObj.GetLotsOfUsers;
> > while not User.eof do
> > begin
> >   ShowMessage(User.Name);
> >   User.Next;
> > end;

> > Does anybody else do something similar or know of a place I can get some
> > whitepapers or code samples.  Also am I going in the right direction
> or
> > are there drawbacks to this method.

> > Thanks.
> > Stephen