incubator-clerezza-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reto Bachmann-Gmür <reto.bachm...@trialox.org>
Subject Re: extending GraphNode with generics
Date Fri, 20 May 2011 10:11:46 GMT
I think it is very straight forward to add a generic type to graphnode. It needs changing lots
of code to prevent warning, in most cases i think we have to add a <?> or <Resource>,
the situation where we actually have a method declared to return an objetc with a concrete
type param are relatively seldom.

What motivates the change? Graphnode is a convenience object, where not all methods are usable
for every instance. Rather than having generics we could also just have 3 or 4 subtypes, in
this cas we could not just have more concrete return types for getNode but also have methods
that only apply to a specifc type.

But again, seeing where you think the change would bring concrete benefits would make it easier
to discuss the proposal.

Cheers,
reto

----- Original message -----
> 
> On 20 May 2011, at 00:13, Tommaso Teofili wrote:
> 
> > Hi all,
> > as discussed in CLEREZZA-537 it may be worth having GraphNodes use
> > generics to add something like "T extends Resource" parameter allowing
> > easiest subject type retrieving (avoiding useless casts, as said by
> > Henry); I plan to create a patch tomorrow so that anyone can review it
> > and we can discuss it (in a new issue).
> > Regards,
> > Tommaso
> 
> +1 for me. Be interested to see how it works out.
> 
> Henry
> 
> Social Web Architect
> http://bblfish.net/
> 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message