• No results found

Productivity Comparison for Building Applications and Web Services

N/A
N/A
Protected

Academic year: 2021

Share "Productivity Comparison for Building Applications and Web Services"

Copied!
13
0
0

Loading.... (view fulltext now)

Full text

(1)

Productivity Comparison

for Building Applications

and Web Services

Between The Virtual Enterprise, BEA

WebLogic Workshop and IBM

WebSphere Application Developer

Prepared by

Intelliun Corporation

CONTENTS

- Introduction - Building a Sample Application Using VE - Executing the Application - Web Services Support - Handheld Device Support - Approach Differences - Conclusions

(2)

Introduction

This white paper demonstrates the power and productivity of The Virtual Enterprise (VE) in comparison to BEA’s WebLogic Workshop, and IBM’s WebSphere Application Developer (WSAD)1. BEA produced a white paper2 comparing the productivity of Workshop and WSAD via the implementation of a simple example. This paper documents the implementation of the same example using VE, and discusses the approach differences between these three technologies.

The example application consists of a very simplistic employee database with the following use cases:

- Add a new employee record (including id, name, manager name, and phone) - Find an employee name by id, and

- Find an employee id by name.

The example exposes these functionality as Web services. In addition, the VE implementation provides web browser access and handheld device (PDA) access for all of the three use cases. Although VE can run on a wide range of J2EE servers including WebLogic 7.0 Server, for the sake of this white paper and avoiding any licensing violations, the VE/Server used in

implementing this example was running on Tomcat 4.0, while the example Email System EJB (provided by BEA) was running on the WebLogic server on the same machine.

The following sections include:

- Building the sample application using VE, - Executing the application,

- A discussion of web services and handheld device support,

- A discussion of the differences in approach between VE, Workshop, and WSAD, and - Conclusions from the results.

1

All trademarks are the property of their respective companies.

2

(3)

Building a Sample Application Using VE

Required Skills: VE/Designer Cumulative Effort: 0:15 minutes Step 1:

After starting VE/Designer, create a new project by right clicking on any folder and then selecting New Project. Name the project HRDemo2. Create a package named hr by right clicking on the HRDemo2 project and selecting

New Package. With this step you

have created a project with one package underneath. Required Skills: VE/Designer UML Class Diagram Cumulative Effort: 1:45 minutes Step 2:

VE/Designer allows you to build the object model visually. To create an object for the employee information, select the Object Tool in the tool bar and drop it on the canvas to place the object. A dialog box will appear in which you can enter the meta object name Employee and then enter the attributes idnumber, name, manager,

and phone. Press OK and the object

will appear on the canvas.

Create a root object (Singleton) to Employee by selecting the Root tool in the toolbar and dropping it on the Employee object while holding the shift key. VE will create a new root object and name it AllEmployees.

The last step is to double-click on the

idnumber attribute and add a counter

formula to default value:

(4)

Required Skills: VE/Designer Cumulative Effort: 2:15 minutes Step 3:

Import the EmailSystemEJB by right clicking on the HRDemo2 project and selecting Import EJB. Specify the package name which to import the EJB into, followed by the JNDI connection information. In this case, we’ll create a new JNDI connection, name it WL-Localhost, and then provide the URL to the running WebLogic server. Upon creating the appropriate JNDI connection, you can browse available JNDI entries, or enter the JNDI path for the EJB Home. In this case EmailSystemEJB. To verify the path, click on the Verify button, and VE will retrieve the EJB information and update both the home interface and remote interface information. Press the Submit button and you’re ready to use the imported EJB.

Required Skills: VE/Designer UML Activity Diagram Cumulative Effort: 4:15 minutes Step 4:

Create a new process by right clicking on the package icon and selecting

New Process from the menu. Name

the process addNewEmployee. An icon for the process is inserted under the package. Under the properties tab, add parameters name, manager, and

phone. Switch to the Process Diagram

tab and add the desired business logic. In this case, add three activities: the first to create a new Employee object, the second to add the new object to AllEmployees and the last is to call createNewEmail() of the imported session bean. Here are the activities:

emp = new( #hr/Employee, ‘( name = $name; manager = $manager; phone = $phone ) )

#hr/AllEmployees.add( emp ) newEmailAccount( emp.idnumber, name )

(5)

Required Skills: VE/Designer UML Activity Diagram Cumulative Effort: 6:15 minutes Step 5:

Create a new process by right clicking on the package icon and selecting

New Process. Name the process

findEmployeeById. An icon for the

process is inserted under the package. Under the properties tab, add an id parameter and specify the return type as Employee. Switch to the Process Diagram tab and add the desired business logic. In this case, this is a very simple process with actually no activities. Instead, all we need is to find an employee object in the root

AllEmployees with a idnumber equal to

the id parameter, then return to the caller. The formula for the return value is:

#hr/AllEmployees[ idnumber == $id ] Repeat this step for the

findEmployeeByName process, and

set the return result to:

#hr/AllEmployees[ name == $name ]

Required Skills: VE/Designer UML Activity Diagram Cumulative Effort: 10:45 minutes Step 6:

Create one more process to initialize the database, initializeTable.3

This process includes two activities: the first to initialize an array of employee data, and the second to add the array as Employee objects to

AllEmployees.

The following are the two formulas for the activities created above:

emps = { { 10010, "Frank", "Dawn", "303-555-1212" }, { 10023, "Sam", "Tyler", "650-555-1212" }, { 10045, "Maddy", "Alfred", "781-555-1212" }, { 10051, "Jack", "Alfred", "212-555-1212" }, { 10061, "Lorette", "John", "978-555-1212" } }

enumerate( emps, '( #hr/AllEmployees.add( new( #hr/Employee, '( idnumber = $element[ 0 ] ; name = $element[ 1 ] ; manager = $element[ 2 ] ; phone = $element[ 3 ] ) ) ) ) )

3

(6)

At this point all information to complete the application itself, including both user interfaces as well as application logic has been entered and the application can be run in memory by simply clicking on the green play button—there is no code-generation, nor compile time.

Required Skills: VE/Designer Cumulative Effort: 11:45 minutes Step 7:

To create and deploy the application to a database, right click on the project icon and select Deploy. VE will provide you with a set of pages to create a new database instance and a datasource. Name the datasource

hrdb and then submit the form. VE will

analyze the object model and create the appropriate DDL (database schema), object-relational mapping and optionally update the specified database automatically. Required Skills: VE/Designer Cumulative Effort: 13:00 minutes Step 8:

To complete the final step of the application, select the default portal under the project, then add three navigations, Add Employee, Find by

ID, and Find by Name. Specify the

processes addNewEmployee,

findEmployeeById, and findEmployeeByName to the

navigations respectively. Set the type for all three navigations to Execute.

Step 9:

At this point, the application is complete. However, we’ve intentionally excluded the initializeTable process from the default portal, as it’s a one time data loading process and not appropriate for external access. To run the initializeTable process, right click on the process and select Execute. Now we’re done! To launch the application, just right click on the

(7)

This application was developed and deployed in thirteen minutes from start to finish using The Virtual Enterprise. Admittedly, this is a simple example, however, it covers the creation of basic functionality, integration with a relational database, and integration with an existing EJB. More complicated applications can similarly be developed by simply capturing the business logic— namely objects, processes, and rules—without writing a single line of Java code; nor, learning the 10 to 20 different standards and specifications involved in building n-tier J2EE applications and Web services.

(8)

Executing the Application

The screen shot to the right shows the execution of the addNewEmployee process to support the entry of employee name, their manager and the employee phone number.

The screen shots to the right show the execution of the findEmployeeById process to search by a given employee ID number.

The screen shots to the right show the execution of findEmployeeByName process to search by a given employee name.

Note that the application shown is completely generated based on the steps described previously according to the default look-and-feel set in VE. VE/Designer also provides a powerful WYSIWYG editor for customizing all aspects of the web page-based user interface and rendering a very sophisticated user experience, still without requiring any HTML, CSS, JavaScript, or XSL experience.

(9)

Web Services Support

Thus far, we have not done anything regarding Web services. However, just like the dynamically generated HTML web pages, VE automatically creates WSDL documents appropriate for each portal, and to respond to incoming SOAP messages. VE views Web services as just another interface layer (or access device), and maintains the focus of the functionality on the application logic—objects, processes and rules.

In this example, there is only one portal, default. Accordingly, entering the default portal URL with the web services extension, in this case default.wsdl, will dynamically return the appropriate WSDL to match the portal specifications and application logic. Similar to the user interface personalization, the developer has the ability to alter the generated WSDL, for example, document versus rpc style.

(10)

Handheld Device Support

As built and deployed earlier, the application is automatically available for access via handheld devices such as the PocketPC using Pocket Internet Explorer and other similar handheld device browsers. The pictures below show the same application built above without any additional steps accessed from a PocketPC device.

All functionality of the application is available to handheld users, who would use the data entry capabilities of the device to enter information or press buttons as appropriate. The screen shot to

the right shows the

addNewEmployee process.

The screen shots to the right show the execution of the

findEmployeeById process to search by a given employee ID number.

(11)

The screen shots to the right show the execution of

findEmployeeByName process to

search by a given employee name from a PDA.

Note that these pictures show the default application look-and-feel as generated by VE. However, the VE/Designer provides WYSIWYG personalization capabilities for handheld devices, still without requiring any additional skills.

Approach Differences

While both WSAD and Workshop use traditional Java development for building applications, Workshop provides a framework for abstracting out some of the more mundane code pieces associated with J2EE development. VE, on the other hand, goes several steps further providing a model-driven development environment along with a framework to abstract out all of the technology related code. Each of the above approaches has its pros and cons and appeals to a different type of audience.

WSAD

With WSAD, you get a complete IDE with full access to Java and the entire J2EE set of API’s. Although WSAD is geared toward building n-tier applications and Web services, it’s still a generic IDE for basic Java development. WSAD also includes a set of wizards to generate various J2EE and Web services code, which improves productivity over hand-built applications. WSAD makes a powerful environment for mid-level to advanced J2EE developers, while it’s overwhelming to junior J2EE developers and J2SE developers. Once the wizard generates J2EE code, the developer has to have a good understanding of the API’s and the rest of the involved technologies to add the application logic and complete the development.

Workshop

With Workshop, you get a specialized IDE that is geared exclusively toward building Web services. The IDE layers on top of a framework that abstracts out some of the complexities associated with J2EE API’s, and introduces a simpler common model to interact with external resources called controllers. Controllers offer a unified abstraction to represent databases, EJB’s, or even third party software.

(12)

To build a new Web service, a Workshop developer has to identify the needed controllers, and then write Java methods that use these controllers to deliver the desired services. Identifying a controller can be as easy as specifying the JNDI path of an existing EJB or reusing an already built database controller, or it can entail building a new database controller, which requires SQL knowledge and an understanding of the database particulars.

Although things can get a little more complicated when dealing with objects, not just primitive types, it is still far simpler than dealing with the raw set of J2EE API’s or the abundance of generated code. On the other hand, unlike WSAD, Workshop is only appropriate for building Web services. If you’re building a full n-tier business application, for example, you will have to use third party IDE’s and development tools to build your business logic as EJB’s, and the presentation layer as maybe JSP or HTML.

VE

VE takes a different slice at reducing complexity. VE’s sweet spot is building n-tier applications and Web services that take full advantage of the J2EE architecture, similar to WSAD. However, to reduce complexity, VE provides an IDE (VE/Designer) that layers on top of a framework for representing business logic in its basic form as objects, processes, and rules, yet completely independent of J2EE or any of the involved technologies. VE/Designer uses UML to capture the business logic, and XML to store it. VE/Server, which runs on any J2EE server, loads the application logic from XML files into fully functional J2EE components that are ready to test and execute. No code generation, nor the need to understand or manipulate the generated code. VE/Designer provides a comprehensive IDE for building n-tier applications and Web services. This includes the application logic layer, which can run as pure Servlets or Servlet/EJB combination; the presentation layer, which supports multi-device thin-client access such as web browser, PDA browser, and Web service; and the database layer, which supports relational databases with JDBC driver support. VE also supports the import and integration of external resources like existing databases, EJB components, and Web services, while providing a framework for defining proprietary resources.

VE’s implementation of a framework for representing the basic components of business logic does add an overhead in comparison to hand-written Java code. However, this overhead is offset by optimizations in the way the framework interacts with the underlying J2EE server compared to common practices of hand-built J2EE code. In addition, VE/Server takes full advantage of J2EE high-scalability and fault-tolerance features provided by the underlying J2EE server.

Although VE’s productivity gains are phenomenal, it might not appeal to hard-core J2EE developers that want to see and touch the code and use the raw J2EE API’s--just like an assembly developer would feel toward using C or C++. VE, however, can be used by a wide range of users, including non-programmers, and can provide an excellent environment for learning object-oriented modeling and development without worrying about 3GL level constructs, API’s, or lengthy compilations.

Deviation in Implementations

The three implementations vary slightly because of the differences in approach discussed above. Here is a quick summary:

- In Workshop, the Web service functionality is represented in Java code (no support to Session Bean development in Workshop)

(13)

- In WSAD, Web service functionality is represented as a Session Bean (no support for Web services outside EJB in WSAD)

- In VE, services for creating and dropping Employee_Files table are omitted as they are provided automatically in the underlying framework. This is also more in line with common practices in building real-life applications.

Conclusions

There are a variety of languages and development approaches in the software industry. Some tools and languages are more suitable for developing certain types of software than others. A 3GL, like Java, is definitely less appropriate in developing business type applications compared to a 4GL for example. For developing n-tier applications and Web services, VE’s model-driven approach demonstrates the highest level of productivity and maintainability in comparison to competing approaches. VE’s implementation is the first and only code-free executable UML available today, and has the potential of spawning a new generation of n-tier applications. The following is a summary comparison for the three implementations as applied to the simple HR system described in this paper.

WSAD Workshop VE

Java line-of-code (LOC) 185 26 0

SQL Statements 6 6 0

VE Formulas (the closest to LOC) 0 0 8

References

Related documents

– Rapid application development with Application Express (APEX) – Database access through RESTful Web Services. – SQL Developer for creating and managing data and data structures

For access to 101° satellite programming, connect the primary and secondary ports of the antenna to both SWM inputs corresponding to Satellite 99°/101°.. Terminate unused

Double layer material over knees, shoulders, and buttocks durability and visibility - Select your color from an extensive list of colors and fabrics – See Color Chart Select your

ADVANCED TOPICS IN COMPUTING 2 (Elective/Semester Course) .5 credit 2644 This course is intended for those students having a high interest in computers and having the desire

?iscrepancies could be seen among the three brands when respondents were as'ed if the shampoo is recommended by hair experts with Head and $houlders receiving higher scores than

CMS-based Web applications as a Web application for the management and control of content.. Web Application

In addition to the Web services technologies provided out of the box in the Java System Application Server 8.1, the add-on Java Web Services Developer Pack (WDSDP) provides

După cum se ştie, numărul luptătorilor lui Leonidas era foarte mic (de zece ori mai mic decât cel de care dispunea generalul Larionov, fără a mai vorbi despre lipsa trenurilor