|
From: Kevin S. (JIRA) <no...@at...> - 2007-07-29 16:31:27
|
[ http://opensource.atlassian.com/projects/spring/browse/RCP-453?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kevin Stembridge resolved RCP-453.
----------------------------------
Resolution: Fixed
> LabelInfoFactory will be deprecated in favour of a factory method on LabelInfo itself
> -------------------------------------------------------------------------------------
>
> Key: RCP-453
> URL: http://opensource.atlassian.com/projects/spring/browse/RCP-453
> Project: Spring Framework Rich Client Project
> Issue Type: Improvement
> Components: Application Framework
> Affects Versions: 0.2.1
> Environment: All
> Reporter: Kevin Stembridge
> Assignee: Kevin Stembridge
> Priority: Minor
> Fix For: 0.3.0
>
>
> This issue relates to an improvement to the way that LabelInfo instances can be created. In particular, the removal of the LabelInfoFactory class and the addition of a factory method on the LabelInfo class. The reasoning behind this change is explained below.
> Using LabelInfoFactory, a LabelInfo can be created in 3 ways:
> 1. Create a new LabelInfoFactory using the no-args constructor, then set the encodedLabel, then call createLabelInfo().
> 2. Create a new LabelInfoFactory using the constructor that takes the encodedLabel as an argument, then call createLabelInfo().
> 3. Call the static method that takes an encodedLabel.
> Note that the implementation of option 3 just performs option 2.
> There is no reason to store the encodedLabel in a public instance variable. The class could be stateless and provide only a static factory method.
> So if LabelInfoFactory is whittled down to a single static factory method, the next question to ask is 'Do we need to allow for pluggable syntaxes?', whereby users may choose to use a different syntax to the one currently used.
> If so, then the factory should become an interface, with the existing LabelInfoFactory being the default implementation.
> If not, then there doesn't seem to be any need to separate the creation of a LabelInfo from the LabelInfo class itself. It would be better to add a static createLabelInfo(String encodedLabel) method to the LabelInfo class and do away with the factory altogether.
> After discussions on the dev mailing list, the second approach was considered to be the best choice because:
> * It doesn't seem unreasonable to ask users to work with the syntax we have already defined because the only special characters we are using are &, @ and the KeyStrokes that are part of the core Java API, e.g. ctrl.
> * The other approach would add complexity by requiring the factory implementation to be injected into all the classes that need to create LabelInfo objects, some of which may not be created by the Spring IoC container.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/spring/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|