I recently faced this issue and I did something like this:

public interface SalesDepartment {
        public void addSalesPerson(SalesPerson sp);
        public SalesPerson getSalesPerson(ID id);          // each SalesPerson has a 
unique ID
        public SalesPerson[] getSalesPersons();
        public void updateSalesPerson(SalesPerson);
        public void removeSalesPerson(ID);
        // other SalesDepartment methods ...
}

The idea is that SalesPerson is a component, but more
specifically SalesPerson is a service data component
managed by the SalesDepartment service.  

I would be very interested to see what others think of this
approach, since I am new to Avalon.

-garth


-----Original Message-----
From: Dennis Kang [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 11, 2002 12:12 PM
To: Avalon framework users
Subject: how to instance components when there are datamembers


In Avalon, the typical way to get a component is to
use serviceManager(originally componentManager)'s
lookup method. But what should it be when one
component contains other components.

For example, we have component SalesDepartment and
SalesPerson, the SalesDepartment has an array of
SalesPerson. How could SalesDepartment initialize the
SalesPerson arrays and implement some function like
add a new SalesPerson?

Thanks.
Dennis

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to