38
Платформа Java и IDE Netbeans 6.7 для разработки Enterprise (корпоративных) и Web приложений Андрей Родионов Community manager Sun Microsystems

Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications

  • Upload
    ssa-kpi

  • View
    2.146

  • Download
    6

Embed Size (px)

DESCRIPTION

AACIMP 2009 Summer School lecture by Andrii Rodionov (Sun Microsystems). "Information Technology" stream. Sun Microsystems course. Part 4.

Citation preview

Page 1: Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications

Платформа Java и IDE Netbeans 6.7 для разработки Enterprise (корпоративных) и Web приложений

• Андрей Родионов• Community manager• Sun Microsystems

Page 2: Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications

Перечень тем• Двух- и трех– уровневая архитектура приложений• Обзор Java платформы: Java SE, Java EE, Java ME• IDE NetBeans как среда разработки разных типов

приложений• Возможности Java EE для построения трех(много)-

уровневых приложений• Glassfish Application Server - обзор, демонстрация работы• Технологии для разработки Web-уровня• Технологии для разработки бизнес-уровня• Практика

> Web service> Java persistence> EJB

Page 3: Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications

«Drinkens, Who is this?»

Page 4: Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications

3 Million People a Week Join the Network!

Page 5: Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications

Java SE, Java EE, Java ME

Page 6: Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications

Java SE, Java EE, Java ME

Page 7: Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications

NetBeans IDE 6.7 Features• Java SE (Java Standard Edition)• Web and Java EE (Java Enterprise Edition)

> Web Applications> Java EE Applications> Web Services

• Mobility (Java Micro Edition)• Ruby, JRuby, Ruby on Rails• C and C++• UML• SOA, XSLT Designer, WSDL and XML• JavaFX• Project Kanai

Page 8: Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications

Двух- и трех– уровневая архитектура приложений• Возможность использования

различных языков программирования для различных компонентов

• Централизация компонентов • Балансировка нагрузки • Более эффективный доступ к

данным • Улучшенная защита • Более простой доступ к внешним

ресурсам

Page 9: Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications

Java SE, Java EE, Java ME

Page 10: Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications

Java Stadard Edition

Page 11: Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications

Java Enterprise Edition• Построена на Java Standard Edition (Java SE)• Web Application Technologies• Web Services Technologies• Enterprise Application Technologies• Management and Security Technologies

• Sun Java System Application Server (Glassfish)

Page 12: Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications

Java EE для построения трех(много)-уровневых приложений

Page 13: Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications

Java EE Components

• Application clients and applets are components that run on the client

• Java Servlet, JavaServer Faces, and JavaServer Pages (JSP) technology components are web components that run on the server

• Enterprise JavaBeans (EJB) components (enterprise beans) are business components that run on the server

Page 14: Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications

Java EE Clients

• Web Clients> dynamic web pages containing various types of

markup language (HTML, XML, and so on), which are generated by web components running in the web tier

> web browser, which renders the pages received from the server

• Applets• Application Clients• The JavaBeans Component Architecture

Page 15: Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications

Java EE Server Communications

Page 16: Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications

Web Components• Java Servlet technology• Java Server Pages (JSP)• Java Server Faces (JSF)

Page 17: Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications

Business Components &Enterprise Information SystemTier

Page 18: Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications

Архитектура API Java EE

Page 19: Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications

Java EE 5 APIs• Java ServletTechnology• JavaServer PagesTechnology• JavaServer Pages

StandardTag Library• JavaServer Faces• Java Message Service API• JavaTransaction API• JavaMail API• JavaBeans Activation

Framework• Java API for XML Processing• Java API for XMLWeb

Services (JAX-WS)

• Java Architecture for XML Binding (JAXB)

• SOAP with Attachments API for Java

• Java API for XML Registries• J2EE Connector

Architecture• Java Database Connectivity

API• Java Persistence API• Java Naming and Directory

Interface• Java Authentication and

Authorization Service

Page 20: Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications

Типы Web-приложений

• Presentation-oriented> A presentation-oriented web application generates

interactive web pages containing various types of markup language (HTML, XML, and so on) and dynamic content in response to requests.

• Service-oriented > A service-oriented web application implements the

endpoint of a web service. Presentation-oriented applications are often clients of service-oriented web applications

Page 21: Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications
Page 22: Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications

Технологии для разработки Web-уровня• Java Servlet technology• Java Server Pages (JSP)• Java Server Faces

Page 23: Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications

Java Servlet technology• A servlet is a Java programming language class

Page 24: Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications

Java Server Pages (JSP)• JavaServer Pages (JSP) technology allows you to easily create web

content that has both static and dynamic components• A JSP page is a text document that contains two types of text: static

data, which can be expressed in any text-based format (such as HTML, SVG,WML, and XML), and JSP elements, which construct dynamic content

Page 25: Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications
Page 26: Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications

Java Server Faces• JavaServer Faces technology is a server-side user

interface component framework for Java technology-based web applications

Page 27: Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications

Технологии для разработки бизнес-уровня• Web Services• Enterprise JavaBeans (EJB)

> Session Bean (Stateful, Stateless)> Message-Driven Beans

• Java Persistence

Page 28: Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications

Web Services• Дает возможность удаленного вызова функций по

протоколу HTTP• Клиент и сервер могут базироваться на разных

программных платформах• Стандарт передачи данных SOAP (формат XML)

Page 29: Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications
Page 30: Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications
Page 31: Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications
Page 32: Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications

Enterprise JavaBeans (EJB)• Written in the Java programming language, an

enterprise bean is a server-side component that encapsulates the business logic of an application. The business logic is the code that fulfills the purpose of the application.

• Enterprise beans simplify the development of large, distributed applications

• Enterprise beans are portable components, the application assembler can build new applications from existing beans

Page 33: Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications

When to Use Enterprise Beans?• The application must be scalable. To accommodate

a growing number of users, you may need to distribute an application’s components across multiple machines.

• Transactions must ensure data integrity. Enterprise beans support transactions, the mechanisms that manage the concurrent access of shared objects.

• The application will have a variety of clients. With only a few lines of code, remote clients can easily locate enterprise beans. These clients can be thin, various, and numerous.

Page 34: Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications

Types of Enterprise BeansSession Bean - a session bean represents a single

client inside the Application Server. To access an application that is deployed on the server, the client invokes the session bean’s methods> Stateful> Stateless

• Message-Driven Beans - a message-driven bean is an enterprise bean that allows Java EE applications to process messages asynchronously. It normally acts as a JMS message listener, which is similar to an event listener except that it receives JMS messages instead of events.

Page 35: Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications

Stateful session bean

• The bean’s state represents the interaction between the bean and a specific client.

• The bean needs to hold information about the client across method invocations.

• The bean mediates between the client and the other components of the application, presenting a simplified view to the client.

• Behind the scenes, the bean manages the work flow of several enterprise beans.

Page 36: Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications

Stateless session bean

• The bean’s state has no data for a specific client.• In a single method invocation, the bean performs a

generic task for all clients. For example, you might use a stateless session bean to send an email that confirms an online order.

• A stateless session bean can implement a web service, but other types of enterprise beans cannot.

Page 37: Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications

Message-Driven BeansSession beans allow you to send JMS messages and to

receive them synchronously, but not asynchronously. To avoid tying up server resources, do not to use blocking synchronous receives in a server-side component, and in general JMS messages should not be sent or received synchronously. To receive messages asynchronously, use a message-driven bean.

Page 38: Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applications

[email protected]

http://blogs.sun.com/ntuuhttp://osug.org.ua/

СПАСИБО!