Refactor of JavaFirst

From Eclipsepedia

Revision as of 23:45, 28 October 2007 by Jonathan.huang.iona.com (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

Problems of Current Solution

1). 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. 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.


2). Which class (SEI/IMPL) will be chosen 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?


3). 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.

New Solution for Java First Programming Model

Main Changes

1). The action [Generate Code] for wsdl file will be disabled for java first programming mode.


2). Integrate the new code first tool called "java2ws" in CXF runtime. Using the new tool "java2ws", the webservice artifacts including wsdl, server, client and IMPL/SEI could be generated within one step. For detail description about this integration, please refer to [1]


3). Introduce the "start point" conception which means the input java file(SEI or IMPL) from wich to generate other webservice artifacts.


4). Remove the java2wsdl procedure from the build process and add a new action (right click menu) called [Generate WSDL] for user to invoke the generator tool manually.

Extension Point

STP framework has already had an runtime provider extension point. All the new added extension element will be included in this extension point.

1). javaFirstWizard

To add some runtime specific pages for java first project wizard.

---starting_point_page (Required): To specify starting point page in project wizard. 
---additional_page (Optional): To specify runtime specific pages added to the standard pages in project wizard. It's an optional extension. And no limitation for this extension. If defined, these pages will display in the project wizard.


2). projectPropertyPage (Optional)

To specify the runtime specific property page contents.


3). jaxwsEnableHook and jaxwsDisableHook (Optional)

To add some operation when enable/disable jaxws.

Use Cases

1). If user has nothing.

-User creates a standard java project.
-User creates interface and implementation for this project.
-User uses [Enable JAX-WS] menu to change the project from standard java project to jaxws project and specify the starting point in the popup wizard. 
-STP will annotate the interface or 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.

-User starts the JavaFirst project wizard.
-User specifies the existing interface as the starting point 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. If the runtime choosed by user can generate implementation, STP will use the generator of this rumtime to generate the implementation. 
 

3). If user has an implementation.

-User starts the JavaFirst project wizard.
-User specifies the existing IMPL 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 the implementation.

GUI

Project Wizard

The First Page: User can enter the project name.

Customization: This page can not be customized.

Project-wizard-1.JPG


The Second Page: User can choose the runtime.

Customization: If the following two conditions are satisfied, this page will not be displayed in the wizard and the specified default runtime will be chose. API in RuntimeProviderManager.java can be used to set up default runtime information.

1. The value of [use_default_jaxws_runtime] in preference store is set to [true];
2. The value of [default_jaxws_runtimeType] and [default_jaxws_runtimeID] in preference store is not null.

Project-wizard-2.JPG


The Third Page: User can specify the starting point (SEI/IMPL).

Customization: This page should be provided by runtime provider using the "starting_point_page" extension point. The following picture is an example in CXF runtime:

Cxf-start-point-page.JPG

Additional Pages: User can add any other pages to the project wizard using the "additional_wizard_pages" extension point.

Customization: These pages should be provided by runtime provider using the "additional_wizard_pages" extension point. The following picture is an example in CXF runtime.

Project-wizard-3-1.3.JPG

Preference Page

No change compared with current solution.

Project Property Page

A default project property page will be provided. And user can use the corresponding extension point to replace this project property page.

Property-page-1.0.JPG

Menu

1). When user right click the project in Package Viewer, the menu item [Generate WSDL] will be displayed in the popup menu. User can use it to invoke the java2wsdl generator defined in runtime provider.

Popup-menu-1.2.JPG


2). Enable JAX-WS

Menu-enable-jaxws-1.0.JPG

When user clicks [Enable JAX-WS] menu, a new wizard will be displayed, on which user should choose the runtime and starting point. The wizard is very similar to project wizard except for the first wizard page. In this wizard, user should choose the programming mode in the first page.

Enable-jaxws-wizard-1-1.1.JPG

CXF Integration

Project Wizard

1). Starting_point_page

Cxf-start-point-page.JPG


2). Additional page: Java2ws generator parameters page

Project-wizard-3-1.3.JPG

Project Property

Property-page-1.0.JPG

Right Click Menu

Menu-enable-jaxws-1.1.JPG

The target for the menus is a java-first kind of project. If user chooses [Generate Code], a wizard will be display on which user can specify the options for java2ws generator.

Project-wizard-3-1.3.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-1.0.JPG

The ui of this kind of project wizard will be very similar to the jaxws project wizard with the default runtime used.

JAXWS-RI Runtime

No change compared with current solution.