"Jeffrey Silverman" <jeffreyjhu.edu> wrote in message
news:<pan.2003.08.11.15.14.03.382407jhu.edu>...Notably missing from your description is the proposed functionality>
> I am designing a smallish application to manage members of several
> committees of a particula Organization.
of your software. In other words, you want suggestions as to HOW
to design the software without explaining WHAT this software has to
Why even bother with 'theOrganization' and 'Committee'? They are> The structure of the system is as follows:
> contains Committees
> which in turn contain People
> So theOrganization object is a list of Committee objects which are
> themselves groups of People objects.
nothing but simple arrays... Also, to make things worse, technically,
'theOrganization' should be a singleton... :)
Which leads me to asking, why do you want OO design here in the first> Now, to get the data out of the MySQL database, it is probably more
> efficient to do as few SQL selects as possible. Efficient from a speed
> point of view. However, from a coding/OO-style point of view, it makes
> more sense to have each People object be defined as *one* person -- but
> that would mean that each has data for only one person and that would mean
> a separate SELECT statement for each People object created. (Assuming that
> there is a SQL SELECT in the constructor of each People object or
> something similar to that).
> Traditionally (i.e. non-OO), to code this, I would do as few SQL calls as
> possible. But I can't see how to do that from an OO point of view.
place, if it is to result in lousy performance? Sounds like you are
deliberately setting yourself up for a failure...
These questions would make sense if you were writing a desktop> For example, does it make sense to put all the people data into an array
> outside of the People class and use this list to set up the class
> constructor? (It doesn't make sense to me)
> Or, for example, does it make sense to have the People class just be a
> list of *everyone* in the people table? (This too does not make sense to
> On the other hand, what is the performance impact if I *do* make each
> People class instance be only *one* person?
application. But you're not; by choosing PHP as your development
tool, you have automatically abandoned the traditional concept of
application. You are not designing a monolythic package; rather,
you need to come up with a collection of relatively independent
utilities or modules, each suited for a narrowly defined task.
Until you figure out what those tasks are, you won't be able
to come up with a decent design.