Pierre Hébert with the addition of extend() and getMy() items and containers now share a lot of functionality.
Pierre Hébert with the addition of extend() and getMy() items and containers now share a lot of functionality. Would it be possible to pull this up into a common superclass?
methods I think should be shared:
extend()
getId()
getMy()
getProperties()
get/setTag()
I’m not sure about
getHeight()
getWidth()
getParent()
while position related methods have the same signature too, I don’t think they should be shared as they do completely different things.
]]>« For people interested in scripting, I have updated the sample script package with a new reference plugin… (Previous Post)
(Next Post) Title »
< ![CDATA[
They share some functionalities but that’s mostly a coincidence. I would say that gathering methods under a base class would be factorization, not generalization. I don’t think that having a common ancestor would bring any benefit on the script side, and this won’t be useful on the java code side because not all methods share the same implementations.
In fact some of these methods (extend, my, tag) could have been removed from Container if all containers had an opener item. Using the services offered by the opener item would have been enough (probably). But this is not the case for root containers (desktops). I had the idea to add a dummy opener item for desktops, but too late.
]]>
< ![CDATA[
Pierre Hébert what do you mean by “opener item” ?
]]>
< ![CDATA[
The folder or panel item that gives access to the container
]]>