incubator-clerezza-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tommaso Teofili <tommaso.teof...@gmail.com>
Subject Re: extending GraphNode with generics
Date Fri, 20 May 2011 10:24:49 GMT
Hello Reto,

2011/5/20 Reto Bachmann-Gmür <reto.bachmann@trialox.org>

> 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.


I agree this sounds like a big change; I just thought it'd be good if we
could avoid casts from Resource on getNode() also enhancing type safety when
declaring a GraphNode.
But I am not proposing to just go forward with it, just discuss if we'd like
it :-)


>
> 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,


Subtypes are ok for me as they may come as a better solution in the short
time.


> 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.
>

Regards,
Tommaso


>
> 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