This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | GoF: incorrect default relation names or default values | ||
---|---|---|---|
Product: | uml | Reporter: | Sergey Petrov <sj-nb> |
Component: | Design Center | Assignee: | issues@uml <issues> |
Status: | NEW --- | ||
Severity: | blocker | ||
Priority: | P4 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | uml project with all GOF design patterns applied |
Description
Sergey Petrov
2007-04-24 15:38:01 UTC
see also Issue 98020 There are 33 same problems in DP. The following error message from java compiler gives enough data to understand what should be fixed in UML. Message was received on attempt to compile code generated for default design patterns added into UML project. Creational\AbstractFactory\Client.java:7: <identifier> expected private AbstractFactory ; Creational\Prototype\Client.java:7: <identifier> expected private Prototype ; Structural\Adapter\Adapter.java:7: <identifier> expected private Adaptee ; Structural\Adapter\Client.java:7: <identifier> expected private Target ; Structural\Bridge\Abstraction.java:7: <identifier> expected public static final Implementor ; Structural\Bridge\Abstraction.java:7: = expected public static final Implementor ; Structural\Composite\Client.java:6: <identifier> expected private Component ; Structural\Composite\Composite.java:7: <identifier> expected private Component ; Structural\Decorator\Decorator.java:7: <identifier> expected public static final Component ; Structural\Decorator\Decorator.java:7: = expected public static final Component ; Structural\Facade\Facade.java:7: <identifier> expected private Subsystem ; Structural\Flyweight\Client.java:7: <identifier> expected private FlyweightFactory ; Structural\Flyweight\FlyweightFactory.java:7: <identifier> expected private Flyweight ; Structural\Proxy\Proxy.java:7: <identifier> expected private RealSubject ; behavioral\ChainOfResponsibility\Client.java:7: <identifier> expected private Handler ; behavioral\ChainOfResponsibility\Handler.java:7: = expected private Handler successor; behavioral\Command\Client.java:7: <identifier> expected private Receiver ; behavioral\Command\Invoker.java:7: <identifier> expected private Command ; behavioral\Interpreter\Client.java:7: <identifier> expected private AbstractExpression ; behavioral\Interpreter\NonterminalExpression.java:7: <identifier> expected private AbstractExpression ; behavioral\Iterator\ConcreteIterator.java:4: <identifier> expected import Behavioral.boolean; behavioral\Iterator\ConcreteIterator.java:9: <identifier> expected private ConcreteAggregate ; behavioral\Iterator\Iterator.java:3: <identifier> expected import Behavioral.boolean; behavioral\Iterator\Iterator.java:6: <identifier> expected import Behavioral.boolean; behavioral\Mediator\Colleague.java:7: <identifier> expected public static final Mediator ; behavioral\Mediator\Colleague.java:7: = expected public static final Mediator ; behavioral\Mediator\ConcreteMediator.java:7: <identifier> expected private ConcreteColleague ; behavioral\Memento\Caretaker.java:7: <identifier> expected private Memento ; behavioral\Observer\ConcreteObserver.java:7: <identifier> expected private ConcreteSubject ; behavioral\Observer\Subject.java:7: = expected public static final Observer observers; behavioral\State\Context.java:7: <identifier> expected private State ; behavioral\Strategy\Context.java:7: <identifier> expected private Strategy ; behavioral\Visitor\ObjectStructure.java:7: <identifier> expected private Element ; Created attachment 42440 [details]
uml project with all GOF design patterns applied
I tend to think that this is nothing specific to design pattern library, but rather a generic issue that is better handled at CG phase. Whether or not to set end name is user's preference (Options -> UML -> Java Code Generation / Miscellaneous), even though a navigable association end is not named its corresponding source attribute name should be created with default value, e.g "val" instead of blank which results in broken Java source. Re-categorize it to code generation sub component for evaluation. In my view an attempt to generate code with unnamed part end still looks like a user error, and the bundled patterns should still be corrected to have names placed correctly at part ends. On the other side, i've implemented the auto-generation of attribute name during GC, and this makes the problem less acute/urgent. |