Scjp, scwcd, Oca, OCP
Http://java.sun.com/javaee/downloads (Java ee 5 SDK Preview (des Sun Java System Application Server PE 9 beta))
The advantages of the Java ee 5 platform: A conversation with distinguished engineer Bill Shannon
By Janice J. Heiss, March 2006 |
|
|
Articles Index
Version 5 of the Java platform, Enterprise Edition (Java EE, formerly referred to as J2EE), has arrived. its streamlined features offer added convenience, improved performance, and CED development time, all of which enable developers to bring products to market faster.
To get an update on the Java ee 5 platform, we met with Java EE specification lead Bill Shannon, a distinguished engineer at Sun Microsystems. shannon has been with sun since 1982 and previusly worked on the javamail API, The hotjava views product, the Common Desktop Environment (CDE), the Solaris operating environment, and all versions of SunOS. he graduated from Case Western Reserve University with an MS in computer engineering.
Can you give developers some specific ways that Java ee 5 will reduce the amount of code they need to write?
There are so many ways we 've made life simpler for developers, it's hard to know where to start. to some extent, the amount of improvement you'll see is based on the tools you use.
I think one of the biggest improvements is that, in most cases, you no longer need to use deployment descriptors. even something as simple as combining modules together into an "ear" file used to require a deployment descriptor to list where the modules were. now all you need to do is to put the modules in the ear file in an obvious way, follow some simple conventions like putting all your shared libraries in the "lib" directory, and that's it.
Here's a simple programming example. previusly, to create a web service, you needed to write a Java interface that describes the Web Service API, a Java class that implements the web service, A deployment descriptor that tells the container about the web service, and a configuration file that tells the Web service runtime how to map Java classes to Web service operations. much of this was boilerplate that changed little from application to application. in Java ee 5 all of this can be done by writing a single Java source file -- the class that implements the web service. the rest is taken care of for you by the container, based on Annotations you include in your source code, and based on default rules for what to do when no annotations are present.
Here's the complete source code for a simple Web Service:
Package endpoint; import javax. JWS. WebService; @ WebService public class Hello {Public String sayhello (string PARAM) {return "hello" + Param ;}} |
Time saved
|
"There are so many ways we 've made life simpler for developers, it's hard to know where to start ."
Bill Shannon Distinguished engineer, Sun Microsystems |
Can you estimate how much time a developer wocould save in developing an enterprise application with Java ee 5 compared with J2EE 1.4?
Of course that's difficult to measure and depends a lot on the type of application you're developing. for a relatively simple app, the time to develop the application may be proportional to the number of lines of code in the app. for simple apps, we 've probably ced the number of lines of code you need by half. and if you factor in the Operation ction in the number of concepts you need to understand in order to write such apps, the time to develop the application is even less. for larger enterprise class apps, the bulk of the application is likely to be the actual business logic of the app, and the operation ction in lines of code won't be as great. but the operation in the number of concepts you need to learn will help, and the overall simplification will reduce the drudgery of creating such an app. you really can focus all your attention on your business logic.
Take us through the importance of annotations in Java ee 5.
Java ee has always promoted a declarative approach for your aspects of enterprise application development. without support in the Java language for this style of programming, we used external files -- deployment descriptors -- to hold this declarative information. the use of annotations allows us to move this information into the source code, which is where it belongs in most cases.
So, instead of calling an API to request the container to do something for you, and instead of writing a deployment descriptor that has to be synchronized with the code you're re writing, you can put your request for the container right in the code. you can say "please expose this class as a Web Service" or "please start a transaction when this method is called ".
"If you were scared off of J2EE because it seemed too complex, it's time to take another look ."
Bill Shannon Distinguished engineer, Sun Microsystems |
|
Of course, this new capability in no way removes or interferes with older capabilities. There are cases in which a deployment descriptor is the right approach, and you can continue to use them when desired.
If you cocould speak to an audience of 1000 talented developers who were on the fence, and considering moving to Java ee 5, what wocould you say to them?
This is not your father's J2EE!
If you were scared off of J2EE because it seemed too complex, it's time to take another look. if you 've been attracted to alternative technologies such as spring and hibernate, you'll find yourself of the good ideas from those technologies in Java ee 5.
Take a look at Java ee 5, you'll be amazed at how easy it is.
Try it out! Get started with the Java ee 5 Platform Preview:
- Download the Java ee 5 SDK preview.
- Use the preview: netbeans ide 5.5 with netbeans enterprise pack 5.5 package.
- Need e the source with project glassfish.
|
|
|
Enterprise JavaBeans 3.0 and the Java persistence API
Tell us how the EJB programming model has been simplified in EJB 3.0. How does the use of plain old Java objects (pojos) in EJB 3.0 make programming easier?
First, it's important to understand that the thing people have been calling "EJB 3.0" is really two separate things. the core of EJB 3.0 is a great simplification of the classic EJB programming model. but probably the most exciting work done by the EJB Expert Group is the new Java persistence API.
JAVA persistence is in usually ways a replacement for ejb cmp (container manager persistence), although CMP is still fully supported. java persistence is a much simpler approach to mapping Java objects to relational databases, and benefits greatly from work done in other products and technologies such as Hibernate, toplink, and Java Data Objects (JDO ). the lessons we 've learned from them, and from years of using ejb cmp, led us to create Java persistence. java persistence is a significant departure from ejb cmp, and more resembles those other technologies. java persistence is based on pojos with annotations. java persistence is available both as part of Java EE, and for use outside Java EE in a Java SE environment.
In addition, we 've greatly simplified the basic EJB programming model. it is much easier to write a stateless or stateful component that takes full advantage of the transactional capabilities of the EJB container. EJB components can be written as pojos with, for example, a simple@ Stateless
Annotation. By default, the public methods of the component will be exposed to clients and will run in a transaction. Additional annotations can be used to control security requirements for methods and transaction requirements.
Assumerver faces and Web Application Design
How does the addition of JavaServer faces (JSF) make web application design more convenient?
JSF makes web application development more convenient both in the beginning with which you can write web application code, and in the code that you never have to write at all.
There is a large third-party component market for JSF, which means the developer has the option to leverage high quality supply cial off-the-shelf components in their application. JSF is a Java Community process (JCP) standard that already has broad adoption from major vendors such as IBM, Oracle, Bea, JBoss, and Borland. with such market penetration, you can be sure that your investigation in JSF will be preserved.
The technical convenience of JSF stems from its component model, which allows page authors to compose their user-interface at a higher level of role action than previous technologies. JSF presents a swing-like event model for Web applications that works very well with tools.
Lastly, JSF is very adaptable and extensible. existing popular technologies such as spring and hibernate have embedded JSF adapters to allow their use with JSF. naturally, because JSF is a part of Java ee 5, it integrates very well with Java persistence and EJB 3.0.
Java ee 5 and service-oriented architecture
Let's talk about Service-Oriented Architecture (SOA), which is regarded by following as the next big thing. java ee 5 extends des simplified Web Services Support and the latest web services APIs, making it an ideal implementation platform for SOA. tell us about this.
The Web Services Support in Java ee 5 is based on the JAX-WS (Java API for XML Web Services) and jaxb (Java API for XML binding) APIs, and the web services metadata support defined by JSR 181.
JAX-WS is mostly based on JAX-RPC (Java API for XML-based Remote Procedure CILS), but has been improved to better support the latest web service standards and programming styles.
Jaxb 2.0 is a significant improvement over jaxb 1.0, which adds full support for W3C XML schemas. jaxb is used to map Java classes to XML data and is used by JAX-WS to encode and decode data that is sent in Web Services CILS.
Once again, the use of annotations makes it much easier to create and use web services. JSR 181 defines the annotations that are used with JAX-WS to define Web Services. in the simplest case a pojo is annotated with the @ WebService annotation to make it a web service, as I previously described. jaxb also uses annotations to control the mapping to XML. both JAX-WS and jaxb provide useful defaults so that it's often not necessary to use most of the annotations they provide. the simple cases "just work" and the more complex cases are made easy through the use of annotations.
Why shoshould a developer who has never before used Java technology try Java ee 5?
The specified improvements in Java ee 5 make it much more user-friendly for first-time Java developers, most of whom will want to start with an integrated development environment such as netbeans or Sun Java Studio creator. the IDE can help take you through the steps of creating a Java EE application. you'll find that your applications can be easily be created without detailed knowledge of Java programming. as we talked about earlier, JSF is a key to creating simple web user interfaces using off-the-shelf components.
But an IDE is not necessary to create Java EE applications. some first time Java EE developers might prefer to start by writing simple JSP pages, making use of the JSP Expression Language, and never need to learn the Java language at all.
What shoshould developers understand about the Sun Java System Application Server PE 9.0?
The Sun Java System Application Server, platform Edition 9.0 -- that's a mouthful! -- Is Sun's product version of The glassfish code that serves as the reference implementation for Java ee 5. the PE application server is suitable for development and small scale deployment. sun will also make available an EE (Enterprise Edition) version of the application server that will include more advanced features such as five nines availability.
The PE application server, built from the glassfish code, is the application server embedded in the Java ee 5 SDK, as well as our development tools such as netbeans and Java Studio creator.
The importance of glassfish
What is the significance of glassfish and the open source community? And what shoshould the open source community understand about Java ee 5?
The glassfish community is building a free, open source application server that implements all of Java ee 5. glassfish includes both sun and non-sun contributors. for instance, the Java persistence implementation in glassfish is contributed by Oracle. glassfish really is a community effort. if you're interested in helping to build the reference implementation of the Java EE spec, glassfish is the place to be.
|
"If you're interested in helping to build the reference implementation of the Java EE spec, glassfish is the place to be ."
Bill Shannon Distinguished engineer, Sun Microsystems |
Glassfish is free, and it is open source. I repeat: glassfish is free, and it is open source. glassfish uses the OSI-certified cddl license.
How can developers contriure to the future of Java ee?
There are always ways to contribute to the future of Java ee 5. perhaps the best approach is to go to the Java EE hub page, read the tutorial, download the SDK, try it out, and send us feedback!
Developers who are interested in understanding "how it all works" will definitely want to need e glassfish.
The glassfish site also includes tips and examples that will be useful to developers. developers who want to get involved in contributing to the glassfish project will find instructions there.
Finally, developers who want to contribute directly to the development of future Java EE specs shocould become JCP members, review draft specs, and consider participant ipating in future expert groups to develop specs.
If you were pressed to name the single most important thing to know about Java ee 5, what wocould it be?
it's hard to name just one thing. certainly the thing that pervades all of Java ee 5 and is key to the simplified programming model is annotations. we 've used annotations to make it much easier to deal with persistence, web services, transactions, security, and all the other powerful capabilities of Java ee. we recommend CT that developers will quickly understand and embrace the annotation approach to application development and will then move on to release e the improved persistence and web service capabilities in Java ee 5.