You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@syncope.apache.org by Andrei Shakirin <as...@talend.com> on 2013/01/21 10:29:27 UTC

[Discussion] Rest package names

Hi,

I would like to make a proposal regarding some Rest package names:

1.       Core services implementations: org.apache.syncope.core.services (actually  org.apache.syncope.core.services.impl). "Impl"  ending doesn't bring additional information and doesn't recommended by java best practices. "rest" is deliberately not in package name, because implementation is basically independent from Rest and can be potentially reused for other remote interfaces.

2.       Resource comparators and server exception mapper: org.apache.syncope.core.rest.utils (actually org.apache.syncope.core.rest). It makes purpose of these classes more clear.

3.       Client exception mapper: org.apache.syncope.client.rest.utils (unfortunately cannot be combined with server mapper, because server exception mapper have a lot of dependencies of core specific exceptions).

WDYT?

Regards,
Andrei.

RE: [Discussion] Rest package names

Posted by Andrei Shakirin <as...@talend.com>.
> The classes are referenced from the spring config but they belong to the impl
> classes so why introduce a new package?

Basically we can leave exception mapper and resource comparator in core.services, there is one thing that make me unsure:
Exception mapper and resource comparator depend from CXF, service implementations basically not. Does it make sense to mix these classes in one package?

Regards,
Andrei.

> -----Original Message-----
> From: Christian Schneider [mailto:cschneider111@gmail.com] On Behalf Of
> Christian Schneider
> Sent: Montag, 21. Januar 2013 11:25
> To: dev@syncope.apache.org
> Subject: Re: [Discussion] Rest package names
> 
> On 21.01.2013 11:14, Andrei Shakirin wrote:
> > Hi Christian,
> >
> >>> 2.       Resource comparators and server exception mapper:
> >> org.apache.syncope.core.rest.utils (actually
> org.apache.syncope.core.rest).
> >> It makes purpose of these classes more clear.
> >> Generally I don't like util packages. I would put these helpers into
> >> the same package as the service impls as they are only referenced from
> there.
> > They are referenced not from service package, but from spring service
> configuration.
> > Theoretically they can be used with some different service
> implementations.
> > Perhaps "helpers" sounds better as "utils"?
> The classes are referenced from the spring config but they belong to the impl
> classes so why introduce a new package?
> 
> >
> >>> 3.       Client exception mapper: org.apache.syncope.client.rest.utils
> >> (unfortunately cannot be combined with server mapper, because server
> >> exception mapper have a lot of dependencies of core specific
> exceptions).
> >> Why not client.rest? If we keep the client proxy classes in some form
> >> we could also put it there.
> > I would like to keep it symmetric with core, otherwise it will be confusing.
> Makes sense to make it similar to core. That is why I propose to also avoid
> the util if we avoid it in core. Of course if we choose util in core then it makes
> sense to do the same on the client side.
> 
> Christian


Re: [Discussion] Rest package names

Posted by Christian Schneider <ch...@die-schneider.net>.
On 21.01.2013 11:14, Andrei Shakirin wrote:
> Hi Christian,
>
>>> 2.       Resource comparators and server exception mapper:
>> org.apache.syncope.core.rest.utils (actually org.apache.syncope.core.rest).
>> It makes purpose of these classes more clear.
>> Generally I don't like util packages. I would put these helpers into the same
>> package as the service impls as they are only referenced from there.
> They are referenced not from service package, but from spring service configuration.
> Theoretically they can be used with some different service implementations.
> Perhaps "helpers" sounds better as "utils"?
The classes are referenced from the spring config but they belong to the
impl classes so why introduce a new package?

>
>>> 3.       Client exception mapper: org.apache.syncope.client.rest.utils
>> (unfortunately cannot be combined with server mapper, because server
>> exception mapper have a lot of dependencies of core specific exceptions).
>> Why not client.rest? If we keep the client proxy classes in some form we
>> could also put it there.
> I would like to keep it symmetric with core, otherwise it will be confusing.
Makes sense to make it similar to core. That is why I propose to also
avoid the util if we avoid it in core. Of course if we choose util in
core then it makes sense to do the same on the client side.

Christian


RE: [Discussion] Rest package names

Posted by Andrei Shakirin <as...@talend.com>.
Hi Christian,

> > 2.       Resource comparators and server exception mapper:
> org.apache.syncope.core.rest.utils (actually org.apache.syncope.core.rest).
> It makes purpose of these classes more clear.
> Generally I don't like util packages. I would put these helpers into the same
> package as the service impls as they are only referenced from there.

They are referenced not from service package, but from spring service configuration.
Theoretically they can be used with some different service implementations.
Perhaps "helpers" sounds better as "utils"?

> >
> > 3.       Client exception mapper: org.apache.syncope.client.rest.utils
> (unfortunately cannot be combined with server mapper, because server
> exception mapper have a lot of dependencies of core specific exceptions).
> Why not client.rest? If we keep the client proxy classes in some form we
> could also put it there.
>

I would like to keep it symmetric with core, otherwise it will be confusing.

Cheers,
Andrei.


> -----Original Message-----
> From: Christian Schneider [mailto:cschneider111@gmail.com] On Behalf Of
> Christian Schneider
> Sent: Montag, 21. Januar 2013 11:00
> To: dev@syncope.apache.org
> Subject: Re: [Discussion] Rest package names
> 
> On 21.01.2013 10:29, Andrei Shakirin wrote:
> > Hi,
> >
> > I would like to make a proposal regarding some Rest package names:
> >
> > 1.       Core services implementations: org.apache.syncope.core.services
> (actually  org.apache.syncope.core.services.impl). "Impl"  ending doesn't
> bring additional information and doesn't recommended by java best
> practices. "rest" is deliberately not in package name, because
> implementation is basically independent from Rest and can be potentially
> reused for other remote interfaces.
> Impl is a default name in OSGi to mark the package as private. So I think it is
> not against best practices.
> 
> In this special case I agree though as the service api is defined in
> org.apache.syncope.services. So the core part in
> org.apache.syncope.core.services is already enough to separate those two
> packages.
> 
> >
> > 2.       Resource comparators and server exception mapper:
> org.apache.syncope.core.rest.utils (actually org.apache.syncope.core.rest).
> It makes purpose of these classes more clear.
> Generally I don't like util packages. I would put these helpers into the same
> package as the service impls as they are only referenced from there.
> >
> > 3.       Client exception mapper: org.apache.syncope.client.rest.utils
> (unfortunately cannot be combined with server mapper, because server
> exception mapper have a lot of dependencies of core specific exceptions).
> Why not client.rest? If we keep the client proxy classes in some form we
> could also put it there.
> 
> 
> Christian


Re: [Discussion] Rest package names

Posted by Christian Schneider <ch...@die-schneider.net>.
On 21.01.2013 10:29, Andrei Shakirin wrote:
> Hi,
>
> I would like to make a proposal regarding some Rest package names:
>
> 1.       Core services implementations: org.apache.syncope.core.services (actually  org.apache.syncope.core.services.impl). "Impl"  ending doesn't bring additional information and doesn't recommended by java best practices. "rest" is deliberately not in package name, because implementation is basically independent from Rest and can be potentially reused for other remote interfaces.
Impl is a default name in OSGi to mark the package as private. So I
think it is not against best practices.

In this special case I agree though as the service api is defined in
org.apache.syncope.services. So the core part in
org.apache.syncope.core.services is already enough to separate those two
packages.

>
> 2.       Resource comparators and server exception mapper: org.apache.syncope.core.rest.utils (actually org.apache.syncope.core.rest). It makes purpose of these classes more clear.
Generally I don't like util packages. I would put these helpers into the
same package as the service impls as they are only referenced from there.
>
> 3.       Client exception mapper: org.apache.syncope.client.rest.utils (unfortunately cannot be combined with server mapper, because server exception mapper have a lot of dependencies of core specific exceptions).
Why not client.rest? If we keep the client proxy classes in some form we
could also put it there.


Christian