RE: [Discussion] New REST Service Interfaces - Entitlements
Hi Andrei, === Renaming Service === Rename AuthenticationController to EntitlementService(Impl), since containing methods have little to nothing to do with authentication. It is only about Entitlements... +1 for Entitlement, -1 for Service. I would keep names consistently, if use EntitlementService name, than rename all controllers to services inclusive package name (but I suggest to do it on the later phase). Names will be Consistent. New CXF REST Services will all End with *Service. Old Spring Services currently ending with *Controller will eventually all vanish, once new Services are actually used (migration is complete). Best regards. Jan
RE: [Discussion] New REST Service Interfaces - Entitlements
Btw. I would rather name the xml element Entitlement than EntitlementTO as the fact that it is a transfer object is not important on the xml level. I agree. Not using *TO ending would look nicer on transport layer. The question here is, should we also remove TO in Classnames, or just set a name in annotation, e.g. @XMLRootElement(name = entitlement) ? Christian
Re: [Discussion] New REST Service Interfaces - Entitlements
I would rather do it in the annotations. Internally we often have a internal class without TO and a transfer object that ends in TO. So I think it makes sense to differentiate them on the class level. Christian On 18.01.2013 09:51, Jan Bernhardt wrote: Btw. I would rather name the xml element Entitlement than EntitlementTO as the fact that it is a transfer object is not important on the xml level. I agree. Not using *TO ending would look nicer on transport layer. The question here is, should we also remove TO in Classnames, or just set a name in annotation, e.g. @XMLRootElement(name = entitlement) ? Christian
RE: [Discussion] New REST Service Interfaces - Entitlements
Names will be Consistent. New CXF REST Services will all End with *Service. Old Spring Services currently ending with *Controller will eventually all vanish, once new Services are actually used (migration is complete). Than is absolutely OK for me. + 1. Andrei. Best regards. Jan
RE: [Discussion] New REST Service Interfaces - Entitlements
Hi Syncoper, The following changes are proposed regarding AuthenticationController: === Renaming Service === Rename AuthenticationController to EntitlementService(Impl), since containing methods have little to nothing to do with authentication. It is only about Entitlements... === Changing response Type === listEntitlements() returns a ListString whereas getEntitlements() returns a SetString. From my point of view both methods should return a SET since entitlements have no order and cannot exists or be assigned more than once. Due to some JAX-B / JAX-RS limitations, it is not possible to return a collection with primitive data types in java. A wrapper class is required, e.g. SetEntitlementTO. EntitlementTO can be modeled in one of two ways: Option 1: EntitlementTOs EntitlementTOROLE_ADMIN/EntitlementTO EntitlementTOROLE_SUPERUSER/EntitlementTO /EntitlementTOs Option 2: EntitlementTOs EntitlementTO nameROLE_ADMIN/name /EntitlementTO EntitlementTO name ROLE_SUPERUSER /name /EntitlementTO /EntitlementTOs Option 1 matches more or less current marshaling. I personally would prefer Option 2 because this would give us the opportunity to easily extend EntitlementTO at a later point (if needed) without becoming incompatible with previous version. WDYT? All of these changes will not apply to current Spring Controller/Services, but only future CXF REST Service. So AuthenticationController will not be renamed now, and responsetype of AuthenticationController will not change. Changes only apply for new Service Interface and (Proxy) Implementation. Best regards. Jan
RE: [Discussion] New REST Service Interfaces - Entitlements
And what I forgott to mention: listEntitlements and getEntitlements are not very self-explanatory. A better name would be getAllEntitlements and getMyEntitlements. Regards. Jan -Original Message- From: Jan Bernhardt [mailto:jbernha...@talend.com] Sent: Donnerstag, 17. Januar 2013 14:04 To: dev@syncope.apache.org Subject: RE: [Discussion] New REST Service Interfaces - Entitlements Hi Syncoper, The following changes are proposed regarding AuthenticationController: === Renaming Service === Rename AuthenticationController to EntitlementService(Impl), since containing methods have little to nothing to do with authentication. It is only about Entitlements... === Changing response Type === listEntitlements() returns a ListString whereas getEntitlements() returns a SetString. From my point of view both methods should return a SET since entitlements have no order and cannot exists or be assigned more than once. Due to some JAX-B / JAX-RS limitations, it is not possible to return a collection with primitive data types in java. A wrapper class is required, e.g. SetEntitlementTO. EntitlementTO can be modeled in one of two ways: Option 1: EntitlementTOs EntitlementTOROLE_ADMIN/EntitlementTO EntitlementTOROLE_SUPERUSER/EntitlementTO /EntitlementTOs Option 2: EntitlementTOs EntitlementTO nameROLE_ADMIN/name /EntitlementTO EntitlementTO name ROLE_SUPERUSER /name /EntitlementTO /EntitlementTOs Option 1 matches more or less current marshaling. I personally would prefer Option 2 because this would give us the opportunity to easily extend EntitlementTO at a later point (if needed) without becoming incompatible with previous version. WDYT? All of these changes will not apply to current Spring Controller/Services, but only future CXF REST Service. So AuthenticationController will not be renamed now, and responsetype of AuthenticationController will not change. Changes only apply for new Service Interface and (Proxy) Implementation. Best regards. Jan
Re: [Discussion] New REST Service Interfaces - Entitlements
Il giorno 17/gen/2013, alle ore 14.03, Jan Bernhardt ha scritto: Hi Syncoper, The following changes are proposed regarding AuthenticationController: === Renaming Service === Rename AuthenticationController to EntitlementService(Impl), since containing methods have little to nothing to do with authentication. It is only about Entitlements... Why not AuthorizationController or AccessController? I'd prefer the first one. May be this controller will be improved to add access controller features int the next future (please, take a look at the roadmap). === Changing response Type === listEntitlements() returns a ListString whereas getEntitlements() returns a SetString. From my point of view both methods should return a SET since entitlements have no order and cannot exists or be assigned more than once. Agree Due to some JAX-B / JAX-RS limitations, it is not possible to return a collection with primitive data types in java. A wrapper class is required, e.g. SetEntitlementTO. EntitlementTO can be modeled in one of two ways: Option 1: EntitlementTOs EntitlementTOROLE_ADMIN/EntitlementTO EntitlementTOROLE_SUPERUSER/EntitlementTO /EntitlementTOs Option 2: EntitlementTOs EntitlementTO nameROLE_ADMIN/name /EntitlementTO EntitlementTO name ROLE_SUPERUSER /name /EntitlementTO /EntitlementTOs Option 1 matches more or less current marshaling. I personally would prefer Option 2 because this would give us the opportunity to easily extend EntitlementTO at a later point (if needed) without becoming incompatible with previous version. Agree with you for the reason given above. WDYT? All of these changes will not apply to current Spring Controller/Services, but only future CXF REST Service. So AuthenticationController will not be renamed now, and responsetype of AuthenticationController will not change. Changes only apply for new Service Interface and (Proxy) Implementation. Good. Regards, F.
RE: [Discussion] New REST Service Interfaces - Entitlements
Hi Jan, === Renaming Service === Rename AuthenticationController to EntitlementService(Impl), since containing methods have little to nothing to do with authentication. It is only about Entitlements... +1 for Entitlement, -1 for Service. I would keep names consistently, if use EntitlementService name, than rename all controllers to services inclusive package name (but I suggest to do it on the later phase). === Changing response Type === listEntitlements() returns a ListString whereas getEntitlements() returns a SetString. Option 1: EntitlementTOs EntitlementTOROLE_ADMIN/EntitlementTO EntitlementTOROLE_SUPERUSER/EntitlementTO /EntitlementTOs Option 2: EntitlementTOs EntitlementTO nameROLE_ADMIN/name /EntitlementTO EntitlementTO name ROLE_SUPERUSER /name /EntitlementTO /EntitlementTOs +1 for Option 2 And what I forgott to mention: listEntitlements and getEntitlements are not very self-explanatory. A better name would be getAllEntitlements and getMyEntitlements. +1 Cheers, Andrei.
Re: [Discussion] New REST Service Interfaces - Entitlements
On 17.01.2013 14:43, Fabio Martelli wrote: Il giorno 17/gen/2013, alle ore 14.03, Jan Bernhardt ha scritto: Hi Syncoper, The following changes are proposed regarding AuthenticationController: === Renaming Service === Rename AuthenticationController to EntitlementService(Impl), since containing methods have little to nothing to do with authentication. It is only about Entitlements... Why not AuthorizationController or AccessController? I'd prefer the first one. May be this controller will be improved to add access controller features int the next future (please, take a look at the roadmap). I agree with the names Fabio proposed. If it is planned to put more Authorization stuff in there then it makes sense to not have Entitlement in the name. Like Andrei proposed we should either rename all controllers to Service or none. If we rename them partly people will be confused. === Changing response Type === listEntitlements() returns a ListString whereas getEntitlements() returns a SetString. From my point of view both methods should return a SET since entitlements have no order and cannot exists or be assigned more than once. Agree I also agree with Set. Due to some JAX-B / JAX-RS limitations, it is not possible to return a collection with primitive data types in java. A wrapper class is required, e.g. SetEntitlementTO. EntitlementTO can be modeled in one of two ways: Option 1: EntitlementTOs EntitlementTOROLE_ADMIN/EntitlementTO EntitlementTOROLE_SUPERUSER/EntitlementTO /EntitlementTOs Option 2: EntitlementTOs EntitlementTO nameROLE_ADMIN/name /EntitlementTO EntitlementTO name ROLE_SUPERUSER /name /EntitlementTO /EntitlementTOs Option 1 matches more or less current marshaling. I personally would prefer Option 2 because this would give us the opportunity to easily extend EntitlementTO at a later point (if needed) without becoming incompatible with previous version. Agree with you for the reason given above. Not sure about this one as I do not know how probable it is that we have more attributes in Entitlement. Btw. I would rather name the xml element Entitlement than EntitlementTO as the fact that it is a transfer object is not important on the xml level. Christian WDYT? All of these changes will not apply to current Spring Controller/Services, but only future CXF REST Service. So AuthenticationController will not be renamed now, and responsetype of AuthenticationController will not change. Changes only apply for new Service Interface and (Proxy) Implementation. Good. Regards, F.