[ Team LiB ] Previous Section Next Section

Development Using Workshop

In this section, we describe the various technologies and features of Workshop that help in developing applications on the BEA WebLogic Platform. We also cover the key development concepts that an architect needs to know for tool selection.

Code Annotations in Workshop

Using annotated Java code files is a big push toward streamlining and simplifying J2EE development. Basically what this means is that in place of coding everything manually, the developer inserts special Javadoc tags that will be used to add behavior during execution. This is very similar to the notion of generating stubs and skeletons when working with RMI or EJBs. It is a code generation process. When you decide to build the application, Workshop generates all the required underlying code (similar to running the EJB compiler for EJBs) and deploys it to WebLogic Server.

BEA is working within the Java Community Process (JCP) to make this a standard. Workshop incorporates this concept in a big way within the IDE.

NOTE

For details on the Java Specification Request that aims at standardizing code annotations, see JSR 175 at http://www.jcp.org/en/jsr/detail?id=175.


Workshop JWS

JWS (Java Web Service) is Java code annotation syntax for creating Web Services in WebLogic Workshop. BEA introduced this in the first release of Workshop and has submitted this to the Java Community Process for adoption as a standard.

Workshop leverages Apache Axis as the underlying technology for Web Services. JWS files are created through the Workshop UI and the JWS files are used to generate Apache Axis Web Services at compile time.

NOTE

For details on the Java Specification Request that aims at standardizing JWS files, see JSR 181 at http://www.jcp.org/en/jsr/detail?id=181.


A JWS file is a syntactically correct Java file along with several Javadoc type attributes to enable Workshop developers to leverage powerful Web Services functionality. The underlying infrastructure to support the logic defined in the JWS file is generated behind the scenes.

The basic form of a JWS file includes

  • Javadoc tags that allow WebLogic Workshop to generate the appropriate infrastructure code for the logic

  • A JWS extension that marks this as a Web Service

Java Page Flows

WebLogic Workshop builds on top of the Apache Struts project and introduces what BEA calls Java Page Flows (JPF). Developers can visually build Java Page Flows that define their Web application. All the underlying Struts-based code is automatically generated for them at runtime. This is a very similar concept as the Java Web Services files that we talked about in the previous section.

A JPF is a Java class with Javadoc annotations that define the flow of the Web application. It generally includes one or more JSPs and the appropriate flow to connect activities in the JSP (such as a submit) to Struts-like action classes. The action classes are the classes that manage the Web application and perform logic.

The Workshop IDE is used to visually develop these Java Page Flows. The Source view can be used to add some custom code and develop the JSPs. An example of a Page Flow is shown in Figure C.3.

Figure C.3. Java Page Flows.

graphics/ap03fig03.jpg

Page Flows in Workshop are a good implementation of the Model-View-Controller (MVC) design pattern. Controls implement the model layer of the MVC architecture. JSPs are used for the view, and Java Page Flows are used as controllers.

Page flows enable developers and architects to quickly and graphically design their Web applications. They can drag and drop JSPs, controls, actions, and conditional logic using a graphical palette. Thus, the first pass through the page flows can enable developers or architects to quickly build skeleton applications. They can then come back and implement the logic for the skeleton pieces that they've created. Page flows also support dynamic binding of database types to the JSP, and have several tag libraries to aid in the development of the JSPs. They also manage state transition and XML–Java mapping of the value objects.

Net UI

The Net UI technology is basically a JSP tag library that provides functionality for Web application development in Workshop. These tags help in HTML processing, data binding, and templating.

Net UI HTML Tags

These tags allow the development of dynamic HTML pages. The tags are related to HTML development such as forms, select boxes, radio buttons, and other HTML controls. In addition, these tags also include support for binding to a data source, formatting data for display, and error and exception handling.

Net UI Data Binding Tags

The data binding tags are very powerful. These tags allow the design of dynamic tables with repeating headers, footers, title columns, rows, and so on. They also allow the invocation of other page flows and controls.

Net UI Template Tags

At first glance, the Net UI template tags look like portals. They basically allow HTML pages to be templatized with repeating sections and attributes that can be shared across pages. You should not confuse these with portals, but they do provide some of the very basic functionality that's currently available only in a portal product, in traditional JSP development.

NOTE

The Workshop help files have a complete list of the NET UI tags and Javadocs on how to use them. These can be found at http://edocs.bea.com/workshop/docs81/doc/en/core/index.html.


XMLBeans

XMLBeans is a technology from BEA that allows the manipulation of XML data and files in Java. This is a strongly typed Java object interface for XML data that enables a developer to manipulate raw XML data using the productivity and flexibility benefits of the Java language. Developers see a familiar and convenient JavaBeans-like object-based view of their XML data without losing access to the original native XML structure. Before XMLBeans, developers had to parse XML files using either the DOM or SAX parser to convert the files into Java objects. After manipulation of the Java objects, they would have to be converted back into XML files. As you can imagine, this was a slow and time-consuming process. Using XMLBeans, while developers are manipulating the XML data as if they were Java objects, the XML file underneath is always kept in sync. XMLBeans support technologies such as XML schemas, XQuery, and other XML technologies.

NOTE

You can see the XMLBeans documentation from BEA at http://workshop.bea.com/xmlbeans/docindex.html.


WebLogic Workshop has a built-in visual mapping tool that enables you to map XML data to Java objects. XQuery is used to do this mapping. Figure C.4 shows the visual XML-to-Java mapping tool.

Figure C.4. XML-to-Java mapping.

graphics/ap03fig04.gif

    [ Team LiB ] Previous Section Next Section