Hi
[Using VB6]
I still making the transition from functional to OO programming and struggle
with the program design.
A scenario
I have an app which needs to select one or more person. I have a form
similar to the Outlook addressee form where I can select 1 or many people.
The selected persons will end up in a list box, the contents of which need
to be used elsewhere in my app.
I therefore created a collection class called CPersons (made up of the
CPerson class) which can hold the people selected if necessary.
Q1 Do I need both the collection and the listbox - am I not duplicating
the data. I tended to think that with OO you'd use a collection to hold data
selected and pass that around rather than pass around the list box.
Q2 Should the form driven from within the class (so I'd have a.Select
method which would then open the form) or is the class instantiated from
within the form ( so that the form would handle the populating of the
collection). This seems a bit like a chicken and egg situation
What's the solution ?
Thanks for your thoughts
Simon