You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by "ir. ing. Jan Dockx" <ja...@mac.com> on 2005/08/26 01:25:51 UTC

Re: [jira] Commented: (MYFACES-447) tree2 TreeNode interface has too many methods

Now we are on the list, and we can discuss this ;-).

The first suggested patch doesn't influence anybody, actually, since  
the methods that are removed from the interface are not used by any  
tree2 code. And TreeNodeBase keeps behaving as it did before (actually,  
for it should better be changed too, but it should stay in now at least  
for backward compatibility reasons).

The second suggested patch takes cleaning up the interface further. But  
since the differences between isLeaf(), getChildren().isEmpty() and  
getChildCount() == 0 on the one hand, and getChildren().size() and  
getChildCount() on the other hand, are rather obscure (and, as far as I  
can see, not applied consistently in the existing tree2 code either), I  
bet that there are not that many users out there that depend on the  
differences. If so, please let me know here: it might increase my  
understanding of the differences.
And if your current implementation of a TreeNode is consistent  
(getChildCount() == getChildren().size() and isLeaf() <==>  
getChildren().isEmpty() <==> getChildCount() == 0), this change will  
not affect your code either, since that is how the code is changed in  
tree2 implementation.


On 26 Aug 2005, at 1:10, sean schofield (JIRA) wrote:

>     [  
> http://issues.apache.org/jira/browse/MYFACES-447? 
> page=comments#action_12320067 ]
>
> sean schofield commented on MYFACES-447:
> ----------------------------------------
>
> No you did not miss a discussion.  Don't worry this patch will not be  
> applied in the short term for a few reasons.  The first reason is that  
> it is too close to release time to change an interface.  The second  
> reason is that we will need to do extensive review and consultation  
> with users before a major change such as this.
>
> I'm definitely interested in improving tree2 so I will take a close  
> look at this patch when I get a chance.  We can discuss the changes  
> now even if we don't make them for a while.
>
> @Jan
>
> JIRA is a good place to discuss matters like this (especially when  
> patches are provided to help illustrate the requestor's point.)  In  
> the future can you also email the user list if you have a *major*  
> change of this nature?  Let them know the JIRA link.  That way nobody  
> gets left out of a crucial discussion.  Bug fixes or minor feature  
> additions (that's don't impact existing features, interfaces) can go  
> directly to JIRA though.  This is kind of a special case b/c its a  
> major change.
>
> @Dennis
>
> You may want to add yourself as a watcher to issues when you do spot  
> them on the dev list.  Now that you know you're interested, why take  
> the chance on missing out on an important discussion?
>
>> tree2 TreeNode interface has too many methods
>> ---------------------------------------------
>>
>>          Key: MYFACES-447
>>          URL: http://issues.apache.org/jira/browse/MYFACES-447
>>      Project: MyFaces
>>         Type: Improvement
>>   Components: Tomahawk
>>     Versions: Nightly Build
>>     Reporter: Jan Dockx
>>  Attachments: tree2_TreeNode_extensive_patch.txt,  
>> tree2_TreeNode_extensive_patch_examples.txt, tree2_TreeNode_patch.txt
>>
>> The TreeNode interface is the hook for the backing bean developer,  
>> the user, into the tree2 framework. As such, the interface should  
>> pose minimal requirements for the user. It should only require from  
>> the user to implement those methods that are strictly needed for the  
>> framework to work, and leave as much freedom for the user as  
>> possible.
>> The patch included removes unnecessary methods. Apart from a minor  
>> change in TreeNodeBase, the change doesn't affect the existing tree2  
>> code, nor the example, at all.
>> The patch also contains some documentation for the interface, and  
>> some suggestions for further changes.
>
> -- 
> This message is automatically generated by JIRA.
> -
> If you think it was sent incorrectly contact one of the administrators:
>    http://issues.apache.org/jira/secure/Administrators.jspa
> -
> For more information on JIRA, see:
>    http://www.atlassian.com/software/jira
>
>
Met vriendelijke groeten,

Jan Dockx

PeopleWare NV - Head Office
Cdt.Weynsstraat 85
B-2660 Hoboken
Tel: +32 3 448.33.38
Fax: +32 3 448.32.66

PeopleWare NV - Branch Office Geel
Kleinhoefstraat 5
B-2440 Geel
Tel: +32 14 57.00.90
Fax: +32 14 58.13.25

http://www.peopleware.be/
http://www.mobileware.be/

Re: [jira] Commented: (MYFACES-447) tree2 TreeNode interface has too many methods

Posted by "ir. ing. Jan Dockx" <ja...@mac.com>.
On 26 Aug 2005, at 1:54, Dennis_Byrne@ak.blm.gov wrote:

>
> > The first suggested patch doesn't influence anybody
>
> Your words, in JIRA:
> "The TreeNode interface is the hook for the backing bean developer, 
> the user, into the tree2 framework."
>
> If the TreeNode interface is the hook for the backing bean developer, 
> and the first patch changes the TreeNode interface ... how can the 
> first patch not affect anybody?


Because

1) Removing methods from a super interface doesn't keep you from adding 
similar methods to subclasses (or keeping them from a previous 
implementation); in the supplied patch, the methods are still in the 
class TreeNodeBase.

2) Removing methods from an interface only influences places where 
those methods are called on a variable that has the interface as it's 
static type. The interface is introduced in the tree2 framework for 
this reason: the tree2 code uses variables of static type TreeNode, and 
calls methods on it. But never the methods that are removed in the 
first patch, so it doesn't influence the tree2 code.

3) JSP and JSF EL code and value bindings are interpreted languages, 
that work on the dynamic type of the objects. If the actual 
implementation of your TreeNode offers the used methods, it's enough. 
The interface does not have to offer those methods. (And if your 
implementation of TreeNode offered those methods before, and you don't 
change your code, they will offer them still now).

4) Yes, there is technically a possible influence, if your code ever 
accessed the removed methods on a variable of static type TreeNode. I 
admit. But my point is that there we will no or very little code out 
there in practice that actually does that, since it doesn't make much 
sense for any user code to work with static type TreeNode, and call the 
removed methods. Check you're code, and please tell me if I am 
mistaken.

5) If I indeed am mistaken in step 4), I still think the patch should 
be applied, for reasons mentioned in the JIRA. But then some users will 
indeed be affected, and we surely should wait for version 1.1.0 or 
something, that's makes clear that there are compatibility issues.


Met vriendelijke groeten,

Jan Dockx

PeopleWare NV - Head Office
Cdt.Weynsstraat 85
B-2660 Hoboken
Tel: +32 3 448.33.38
Fax: +32 3 448.32.66

PeopleWare NV - Branch Office Geel
Kleinhoefstraat 5
B-2440 Geel
Tel: +32 14 57.00.90
Fax: +32 14 58.13.25

http://www.peopleware.be/
http://www.mobileware.be/

Re: [jira] Commented: (MYFACES-447) tree2 TreeNode interface has too many methods

Posted by De...@ak.blm.gov.
> The first suggested patch doesn't influence anybody

Your words, in JIRA:
"The TreeNode interface is the hook for the backing bean developer, the 
user, into the tree2 framework."

If the TreeNode interface is the hook for the backing bean developer, and 
the first patch changes the TreeNode interface ... how can the first patch 
not affect anybody? 

Re: [jira] Commented: (MYFACES-447) tree2 TreeNode interface has too many methods

Posted by De...@ak.blm.gov.
> The first suggested patch doesn't influence anybody

Your words, in JIRA:
"The TreeNode interface is the hook for the backing bean developer, the 
user, into the tree2 framework."

If the TreeNode interface is the hook for the backing bean developer, and 
the first patch changes the TreeNode interface ... how can the first patch 
not affect anybody?