abdera-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Koch <tho...@koch.ro>
Subject Confusing inheritence in abdera2
Date Tue, 24 Jan 2012 15:42:32 GMT

please excuse me for spamming the list, but I'll be away for a few days now 
and so I thought I get this out before. Please tell me, if my review is not 

I don't know the Abdera1 code, but may it be possible, that Abdera2 overuses 
inheritence? For me as a newcomer it seems extremly difficult to grasp the API 
with so many levels and directions of inheritence.

Have a look at the type hierarchy of 
org.apache.abdera2.common.protocol.CollectionInfo: There are 44 types and the 
inheritence goes 5 levels down.

Take org.apache.abdera2.protocol.server.impl.SimpleWorkspaceInfo as an 
example. It extends BasicWorkspaceInfo only to add one converter method 
asWorkspaceElement(). But to achieve this, it needs to add a full screen of 
boilerplate code.

An alternative would be to have one Converter class with one convert(Type) 
method per type. This converter could then also hold the Abdera factory 
instance which is currently grapped by asWorkspaceElement() from the global 
name space.

Would you accept a patch for this? Should I fill an issue?
Please compare EffectiveJava Item 16: Favor composition over inheritance.

Best regards,

Thomas Koch, http://www.koch.ro

View raw message