[BBB-DEV] re: Re: re: Re: org.jdesktop.beansbinding.Property should be interface
- From: Kevin Day <kevin@trumpetinc.com>
- To: Better Beans Binding <dev@betterbeansbinding.kenai.com>
- Subject: [BBB-DEV] re: Re: re: Re: org.jdesktop.beansbinding.Property should be interface
- Date: Thu, 16 Jul 2009 15:35:11 -0700
- Organization: Trumpet, Inc.
|
ok - thanks for expanding on it (including examples from your other post in reply to Witold's question). I'm still trying to get my head around how the code would change if Property were an interface (note that I'm not trying to be difficult - I just want to make sure that I clearly understand what's going on).
I think that there are a couple of things that are making this difficult to follow:
1. The use of P$ for the interface name and the static variable. This is, certainly, legal - but it makes it really hard to figure out what's going on.
2. I'm not entirely clear whether the wiki is showing usage scenarios with Property as a base class or as an interface. For example, I see the following code (provided as an example of how property objects would be accessed):
Person.P$.address().street();
If I understand correctly, this particular case is definitely true (this is a leaf property, so it would work). But the following:
Person.P$.address();
would not work (unless we can make Property an interface). Instead, it would have to be:
Person.P$.address().this$();
Have I captured that properly, or totally missed the mark?
If I've got it right, then the block of code that shows:
Person.P$.address().city(); // or
Employee.P$.address().city(); // or Employee.P$.employeeNumber(); would seem to be inaccurate, right? It would only be accurate if Property could be an interface?
I understand that Props is there to provide a reference to the properties of the base class in the hierarchy, but I'm having a hard time extrapolating from there to figure out exactly what the problem is with the abstract base class. Is the problem more of an internal implementation detail of PropsFactory? From the discussion so far, it sounds like it has implications that extend into the actual code of both the bean and the code that uses the properties themselves.
Sorry to be obtuse on this!
- K
----------------------- Original Message -----------------------
From: Peter Levart <peter.levart@marand.si>
Cc: Kevin Day <kevin@trumpetinc.com>
Date: Thu, 16 Jul 2009 14:29:41 +0200
Subject: [BBB-DEV] Re: re: Re: org.jdesktop.beansbinding.Property should be interface
> We do create our own Property implementations (code outside the API), but I could live with Interface + Abstract Base Class as a compromise, if there's a solid reason for making that change. > > My concern, though, is that for the situation that Peter is wanting to use it for (I think - I'm still a little unclear), we would wind up with tons of little implementations of the *interface* in all of our beans, not derived from the base class. > > I'm quite eager to see some examples of how interface would impact his strategy. > - use JDK dynamic Proxies - use multiple inheritance for P$ types |
|
[BBB-DEV] Re: org.jdesktop.beansbinding.Property should be interface |
Fabrizio Giudici | 07/15/2009 |
|
[BBB-DEV] re: Re: org.jdesktop.beansbinding.Property should be interface |
Kevin Day | 07/15/2009 |
|
[BBB-DEV] Re: re: Re: org.jdesktop.beansbinding.Property should be interface |
Peter Levart | 07/16/2009 |
|
[BBB-DEV] Re: Re: re: Re: org.jdesktop.beansbinding.Property should be interface |
Fabrizio Giudici | 07/16/2009 |
|
[BBB-DEV] Re: org.jdesktop.beansbinding.Property should be interface |
Peter Levart | 07/17/2009 |
|
[BBB-DEV] re: Re: org.jdesktop.beansbinding.Property should be interface |
Kevin Day | 07/17/2009 |
|
[BBB-DEV] re: Re: re: Re: org.jdesktop.beansbinding.Property should be interface |
Kevin Day | 07/16/2009 |





