[forge-issues] [JBoss JIRA] (FORGE-1540) Have Project extends MutableFaceted<ProjectFacet> instead of Faceted<ProjectFacet>
George Gastaldi (JIRA)
issues at jboss.org
Fri Jan 31 13:09:28 EST 2014
[ https://issues.jboss.org/browse/FORGE-1540?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12940566#comment-12940566 ]
George Gastaldi commented on FORGE-1540:
----------------------------------------
However IMHO it's best to follow the principle of least privilege and let the impl decide what's best
> Have Project extends MutableFaceted<ProjectFacet> instead of Faceted<ProjectFacet>
> ----------------------------------------------------------------------------------
>
> Key: FORGE-1540
> URL: https://issues.jboss.org/browse/FORGE-1540
> Project: Forge
> Issue Type: Enhancement
> Components: Plugin API
> Affects Versions: 2.0.0.Final
> Reporter: Max Barkley
> Priority: Minor
>
> In order to try and uninstall a facet from a project I must check if it is an instance of MutableFaceted and then cast like so:
> {code}
> if (project instanceof MutableFaceted) {
> ((MutableFaceted<ProjectFacet>) project).uninstall(someFacet);
> }
> {code}
> But as far as I can tell, every Project implementation implements MutableFaceted, so it would be nice if Project extended MutableFaceted so that I could avoid casting.
> Alternatively, if there is a good reason for having Project implementations which are not MutableFaceted, perhaps there could be a MutableProject interface for convenience:
> {code}
> public interface MutableProject extends Project, MutableFaceted<ProjectFacet> {}
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the forge-issues
mailing list