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.

Bug 90617 - Introduce MethodModel for EJB methods creation
Summary: Introduce MethodModel for EJB methods creation
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Martin Adamek
URL:
Keywords: API
Depends on:
Blocks:
 
Reported: 2006-12-05 20:14 UTC by Martin Adamek
Modified: 2006-12-12 13:20 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Adamek 2006-12-05 20:14:19 UTC
With switch to Retouche it is not possible to easily rewrite current
infrastructure for creation of EJB methods. In MethodCustomizer there was
directly used method element from Java infrastrucure API, but that is not very
clean and Retouche API requires to think more about javac context and
'transactions'. Therefore I would like to introduce Java infrastructure
independent method model to use for this. Changes I am thinking about:
1) new friend package org.netbeans.modules.j2ee.common.method 
2) MethodModel immutable class for holding all model data
3) changing org.netbeans.modules.j2ee.common.ui.nodes.MethodCollectorFactory to
accept MethodModel
4) changing org.netbeans.modules.j2ee.common.ui.nodes.MethodCustomizer to accept
MethodModel
5) move MethodCollectorFactory and MethodCustomizer from .ui.nodes to .method
package
6) removing friend package org.netbeans.modules.j2ee.common.ui.nodes
Prototype is ready in j2ee/utilities module at
org.netbeans.modules.j2ee.common.method package. Note, that MethodCustomizer
implementation is just place holder currently.
Comment 1 Martin Adamek 2006-12-05 20:21:36 UTC
This change is in the friend API j2ee/utilities and all affected friends are
under control of our team.
Comment 2 Andrei Badea 2006-12-06 12:23:45 UTC
Looks nice.

Please document if MethodModel's methods can return null. Also document if null
can be passed to the factory methods in MethodModelSupport. Checking is
identifiers passed to MethodModel are really Java identifiers could be also nice.

Is there a client calling MethodModelSupport.createMethodModel(String)? If not,
consider removing that method.

Suggest the factory methods in MethodModelSupport not related to the Java
infrastructure be moved to MethodModel and renamed to create().

Perhaps MethodModel.VariableModel could be named just Variable, don't know.

What is the reason for using '"arg" + index++,' as the variable name in
MethodModelSupport? Why not pass parameter.getName()?

While testing for ElementKind.CLASS in MethodModelSupport.getTypeName() you are
leaving out interfaces and enums. Perhaps you could use ElementKind.isClass()
and isInterface().
Comment 3 Martin Adamek 2006-12-09 15:41:33 UTC
Thanks for comments, I incorporated them all. I will add
org.netbeans.modules.j2ee.common.method to friend packages.