On 2012-09-16, at 12:22 PM, Pascal Robert wrote:

> Hi guys,
> 
> I'm going to add some stuff (MS Exchange and CarDav support…) to ERGroupware 
> in the next couple of months and I'm wondering how I should construct the API.
> 
> Each groupware do mostly the same (adding events, getting a list of contacts, 
> etc.), the main difference is how they do it. For example, CalDav is an 
> extension of WebDav + XML for the body, and MS Exchange is using SOAP.
> 
> So I was thinking of the following:
> 
> - Using interfaces for common methods (createFolder, fetchEvents, etc.) and 
> have a store (MSExchangeStore, CalDavStore, etc.) that will implements those 
> interfaces.

Interfaces, definitely.

> 
> or
> 
> - Using a type to specify the kind of store we will connect to. For example, 
> when constructing a CalendarStore, the constructor will ask for a type 
> (MSExchange, etc.) and the addEvent method will check the type of store to 
> call the corresponding method to add the event in the asked store.

I think you would be better off with a factory method that returned and 
CalendarStore sub-class specific to a type:

CalendarStore cs = CalendarStoreFactory.calendarStroreFor("MSExchange");


Chuck


> 
> or 
> 
> - Using interfaces + delegates.
> 
> Any input?
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      ([email protected])
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net
> 
> This email sent to [email protected]

-- 
Chuck Hill             Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall 
knowledge of WebObjects or who are trying to solve specific problems.    
http://www.global-village.net/gvc/practical_webobjects









 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to