You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chemistry.apache.org by Florian Müller <fm...@opentext.com> on 2010/03/09 16:42:51 UTC

Ids vs. Objects

Hi,

The OpenCMIS client API is a bit inconsistent at the moment. Whenever an object id is required by a method either the id or a CmisObject has to be passed. I think we should make it consistent across all methods.

Passing a CmisObject is convenient if you already have the object and becomes ugly and expensive if you don't have it. Therefore I tend to make those parameters all ids. It's not as nice from an API point of view but it covers more use cases.

WDYT?
 

- Florian

RE: Ids vs. Objects

Posted by Florian Müller <fm...@opentext.com>.
Hi Florent,

That sounds like a good idea. I'll give it a try.


Thanks for sharing,

Florian

-----Original Message-----
From: Florent Guillaume [mailto:fg@nuxeo.com] 
Sent: Tuesday, March 09, 2010 5:07 PM
To: chemistry-dev
Subject: Re: Ids vs. Objects

In Chemistry I use a separate ObjectId class (from which CMISObject
and ObjectEntry both inherit), which makes for a cleaner API IMHO.
ObjectId.getId() returns a string, and conversely from a basic
connection you can create a new ObjectId from a string (to avoid
exposing a concrete constructor).

Florent

On Tue, Mar 9, 2010 at 4:42 PM, Florian Müller <fm...@opentext.com> wrote:
> Hi,
>
> The OpenCMIS client API is a bit inconsistent at the moment. Whenever an object id is required by a method either the id or a CmisObject has to be passed. I think we should make it consistent across all methods.
>
> Passing a CmisObject is convenient if you already have the object and becomes ugly and expensive if you don't have it. Therefore I tend to make those parameters all ids. It's not as nice from an API point of view but it covers more use cases.
>
> WDYT?
>
>
> - Florian
>



-- 
Florent Guillaume, Director of R&D, Nuxeo
Open Source, Java EE based, Enterprise Content Management (ECM)
http://www.nuxeo.com   http://www.nuxeo.org   +33 1 40 33 79 87

Re: Ids vs. Objects

Posted by Florent Guillaume <fg...@nuxeo.com>.
In Chemistry I use a separate ObjectId class (from which CMISObject
and ObjectEntry both inherit), which makes for a cleaner API IMHO.
ObjectId.getId() returns a string, and conversely from a basic
connection you can create a new ObjectId from a string (to avoid
exposing a concrete constructor).

Florent

On Tue, Mar 9, 2010 at 4:42 PM, Florian Müller <fm...@opentext.com> wrote:
> Hi,
>
> The OpenCMIS client API is a bit inconsistent at the moment. Whenever an object id is required by a method either the id or a CmisObject has to be passed. I think we should make it consistent across all methods.
>
> Passing a CmisObject is convenient if you already have the object and becomes ugly and expensive if you don't have it. Therefore I tend to make those parameters all ids. It's not as nice from an API point of view but it covers more use cases.
>
> WDYT?
>
>
> - Florian
>



-- 
Florent Guillaume, Director of R&D, Nuxeo
Open Source, Java EE based, Enterprise Content Management (ECM)
http://www.nuxeo.com   http://www.nuxeo.org   +33 1 40 33 79 87