The EJB 3.0 standard is a powerful Java Enterprise Edition (EE) technology for business components where Java Persistence API contributes to a simplification of creating and using Enterprise JavaBeans. This leads for example to a light model building library, and with a minimum of custom code, you can call methods on the Enterprise JavaBean and bind the results directly to Web Dynpro user interface elements.
Enterprise JavaBeans for Web Dynpro
Imagine you develop composite applications with a rich Web Dynpro table element that shows data from an Enterprise JavaBean (EJB) back end. Combining these three top technologies supported by SAP NetWeaver on top of Java Enterprise Edition (JEE) 5, you get a comprehensive development framework set for creating your business applications sent out to the world via the Web.
This represents a significant simplification when importing one or more EJBs into your Web Dynpro application. For example, business methods are executed in such a way that when the server handles the actions, they are absolutely transparent for you as a developer. While the 2.1 API version is still supported, and object mixtures are allowed, the new Enterprise JavaBean standard is a powerful Java Enterprise Edition technology for business components. The Java Persistence 1.0 API, annotation support, and a simple programming model also contribute to an improved and enhanced development environment.
Let’s take a well-known example and have a look at how few steps are necessary to develop a Web Dynpro user interface with an EJB back end. You add the enterprise application development component that is the container for the EJB development component and that you need to deploy your EJB to the server. By doing this, you are already applying the application functionality such as creating or listing entities – depending of course on your application design. You are now ready to import the EJB model. This is a well pre-defined interface that you access from the Web Dynpro design-time tools. You now just need to set a flag on the public part definition of the development component and trigger the import to generate the model classes. Proceed as usual with the definition of all other required application units such as component, window and views for the user interface design as well as the component interface and the controllers for dataflow purposes. With one single registration of the model in the wdDoInit() method of the responsible controller, you can ensure that all mandatory root elements and their relations (1..1 and 1..N) are automatically created by the Web Dynpro runtime, along with their default instances. You won’t have to instantiate them manually!
For the Java class generation, the EJB model provides the command pattern concept. An operation from the back end is encapsulated and becomes an object representation. According to this concept, each business method of the EJB is represented by a Request model class in Web Dynpro. The Request model class contains all business method input parameters either as properties in case of simple types or as relations in case of collections or arrays. If the business method has a return type, the corresponding Response model class is created as well and is linked as a relation in the Request model class.
Automated Java class generation is just one example of how much you are supported by the Web Dynpro framework when creating business Web applications with a Web Dynpro user interface. Try and find out how easy it is to develop interactive Java applications and start today! To benefit from the new features you get with SAP NetWeaver Application Server and Developer Studio, download the SAP Netweaver 7.1 Composition Environment Trial Version on SDN.