Re: Bad practice in EntityCollection

2016-01-25 Thread Bolz, Michael
Hi all, IMHO it is a “Bad practice” (e.g. see “Law of Demeter” [1]) which is probably also used by others ;) However I agree if such method chaining is used in combination with “Fluent Interfaces/Builder/..” but not for “adding elements to a collection”. But I also respect other opinions ;o)

Re: Bad practice in EntityCollection

2016-01-24 Thread Francesco Chicchiriccò
On 24/01/2016 12:40, mibo wrote: Hi all, During work on olingo-832 I realized that the „getEntities“ method in the „org.apache.olingo.commons.api.data.EntityCollection“ return the list of entities directly (instead of an unmodifiable List). IMHO the best practice for List handling is to retur

Re: Bad practice in EntityCollection

2016-01-24 Thread Ramesh Reddy
IMO, you can start with "addEntity" method, I am not too worried because the consumers of this object typically are serializers, and not a public api where a third party app will call and consume this. On client side API I completely agree with your concern. Ramesh.. - Original Message ---

Bad practice in EntityCollection

2016-01-24 Thread mibo
Hi all, During work on olingo-832 I realized that the „getEntities“ method in the „org.apache.olingo.commons.api.data.EntityCollection“ return the list of entities directly (instead of an unmodifiable List). IMHO the best practice for List handling is to return only unmodifiable Lists and