OOP: How to implement listing al 'Employees'.

Petar perosine at gmail.com
Fri Dec 28 08:19:18 EST 2007


On 28 dec, 13:40, Bjoern Schliessmann <usenet-
mail-0306.20.chr0n... at spamgourmet.com> wrote:
> Petar wrote:
> > What is the better way of doing this? And should a class always
> > reference only on 'item'?
>
> It fully depends on what you want to do in your program. If you just
> want to have a list of employees, a list or dict will suffice. If
> you need a full-fledged employee database, an "Employees" class may
> be a good API.
>
> Regards,
>
> Björn
>
> --
> BOFH excuse #83:
>
> Support staff hung over, send aspirin and come back LATER.

It's a pure hypothetical question about where to put the function for
the list of employees when already having a Employee class.

Do I make it a method of the class, or do i create a instance of the
class for every employee (sitting inside a list)?



More information about the Python-list mailing list