Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Refactor of JavaFirst

Revision as of 23:34, 25 September 2007 by Jonathan.huang.iona.com (Talk | contribs) (New Solution for Java First Programming Model)

Scenario

1). User has nothing.
2). User has an interface without implementation.
3). User has an interface and corresponding implementation.
4). User has an IMPL/POJO without interface.

Problems of Current Solution

1). Current solution can not cover all the cases listed above.


2). There are two steps for user to do his jobs. First is java2wsdl and second is wsdl2java. It’s too “complicated” for user. Actually, from user’s point of view, he does not care what the wsdl file looks like. He only and should only care about the SEI/IMPL. The wsdl file should be transparent for user. So, it needs to generate all artifacts including wsdl file and source codes from SEI/IMPL directly.


3). Further more; it is very possible that user will modify the generated wsdl file after java2wsdl step. Then, the source codes generated by wsdl2java tool from this modified wsdl file may not match the original SEI/IMPL. As the result of this, the service may not work. So, if the wsdl and source codes are generated in only one step, user will have no chance to modify the wsdl file and the problem will not occur.


4). The java2wsdl generator will be invoked each time when building the project. Actually, at most of time, user does not want to invoke the generator. They just only want to modify his SEI/IMPL. And when they think the SEI/IMPL is finished they would want to use the generator to generate other artifacts. So, it needs to provide a selection for user to choose whether build process will invoke the generator or not.


5). Which class (SEI/IMPL) will be chose to start the java2wsdl generator? In current solution, system will go through all the source codes and choose some of them to start the generator. It may be useful for user. But it is very possible that the system chooses a “wrong” class that the user does not want to choose. Actually, user knows his SEI/IMPL very clearly. And it is very easy for user to specify the java class to start the generator. So, why not let user point out which class to be start with?

New Solution for Java First Programming Model

Main Changes

1). In current solution, user can right click the generated wsdl file and select [Generate Code] action in the popup menu. At this time, STP framework will invoke the specific runtime tools with the input wsdl to generate codes. But in the new solution, all the operations will focus on SEI/IMPL. That is to say, the action [Generate Code] (should be called [Generate WS Artifacts]) will start from the SEI/IMPL rather than the wsdl file. The SEI/IMPL will be the only input for the generator tools. For example, if user chooses CXF runtime, with the input SEI/IMPL the generator could generate wsdl, IMPL, server code and client code for user in one step. But if user choose JAXWS-RI runtime, the generator will only generate wsdl file for user. (RI has no function to generate other artifacts.) Any way, there is no limitation for the runtime to provide any more tools.


2). Add a selection for user to switch on/off the generator when building the project. The default value for this selection is false.


3). When starting the generator, user should provide the input class which can be specified in project property page by user. If user specifies an interface as the starting class, he should either provide an implementation or choose to use the generated implementation. Actually, STP will always invoke the genertor with the implementaion class.


4). Add a new action (popup menu) for user to invoke the generator manually.


Extension Point

STP framework already has an runtime provider extension point. In this extension point, a new item called java2wsdl_parameter_page will be added to java2wsdlGenerator.

Use Cases

1). If user has nothing.

-User creates an JavaFirst empty project using project wizard.
-User creates interface and implementation. The implementation class can also be generated automatically by STP as user's selection.  
-User set the interface or the implementation as the starting class from which to start the generator in the project property page.
-User right click the project or the starting class and select the [Generator tool] to start the generator.
-STP will annotate the interface and implementation if these classes have not been annotated as webservice. And then STP will invoke the generater of the coresponding runtime type to generate all the artifacts for user. 

2). If user has an interface without implementation.

-User starts the JavaFirst project wizard.
-User specifies the existing interface as the starting class and chooses using the generated implementation in the wizard page. The dependend java file and libraries can also be added.
-STP will import all the existing java file and libraries to the new created project. And default webservice annnotations will be added to the interface. And also, an implementation will be created for user. If the runtime choosed by user can generate implementation, STP will use the generator of this rumtime to generate the implementation. Otherwise, STP will use default generator to generate the implementation.
-User modifies the implementation class.
-User right click the project or the starting class and select the [Generator tool] to start the generator.
-And then STP will invoke the generator of the coresponding runtime type to generate all the artifacts for user. 




3). If user has an interface with corresponding implementation.

-User starts the JavaFirst project wizard.
-User specifies the existing interface as the starting class and chooses to use the existing implementation in the wizard page. The dependend java file and libraries can also be added.
-STP will import all the existing java file and libraries to the new created project. And default webservice annnotations will be added to the interface and implementation.
-User modifies the implementation class.
-User right click the project or the starting class and select the [Generator tool] to start the generator.
-And then STP will invoke the generator of the coresponding runtime type to generate all the artifacts for user. 



4). If user has an IMPL/POJO with out interface

-User starts the JavaFirst project wizard.
-User specifies the existing IMPL/POJO as the starting class in the wizard page. The dependend java file and libraries can also be added.
-STP will import all the existing java file and libraries to the new created project. And default webservice annnotations will be added to implementation/pojo.
-User modifies the implementation class.
-User right click the project or the starting class and select the [Generator tool] to start the generator.
-And then STP will invoke the generator of the coresponding runtime type to generate all the artifacts for user.

GUI

Project Wizard

The First Page: User can enter the project name

Project-wizard-1.JPG


The Second Page: User can choose the runtime.

Project-wizard-2.JPG


The Third Page: User can choose to create a empty project or to import existing source codes.

Project-wizard-3.JPG


The last Page: User can set the parameters of generator for the specific runtime choosed by user. Different runtime type will have different parameters. The following picture is an example for CXF runtime type.

Project-wizard-4.JPG

Preference Page

No change compared with current solution.(TBD)

Project Property Page

In this page, user can enable or disable the generator when building the project. And also, user can specify from which class to start the generator.

Project-property.JPG

Java2ws Generator Wizard

This wizard will not display if the user has specified the input service class in project wizard or in property page.

Generator-wizard-new.JPG

Right Click Popup Menu

When user right click the project or the java file of this project in Package Viewer, the menu item [Generate WS Artifacts] will be displayed in the popup menu.

Popup-menu-new.JPG

CXF Runtime

Generator Parameters

Different runtime has different generator parameters. STP framework will provide an extension point to support this. The following are CXF runtime parameters:

-databinding
-soap
-verbose
-createxsdimport
-wsdl
-server
-client

And the corresponding GUI provided by extension looks like:

Generator-parameters.JPG

Simple FrontEnd

CXF runtime provides another frontend named "simple frontend". Using this frontend, user can easily generate service artifacts without adding webservice annotations to SEI/IMPL. But the generated service will not be a jax-ws compatible service. So, a new project wizard will be provided in CXF plugin rather than JAXWS plugin.

Simple-frontend-wizard-0.JPG

JAXWS-RI Runtime

No change compared with current solution. (TBD)

Back to the top