| John D. McGregor | |
| Clemson University | |
| johnmc@cs.clemson.edu |
| Support for secure commerce over the Internet | |
| Support for secure services over the Internet | |
| Serve clients |
| Flexibility | |
| Modifiability | |
| Reliability | |
| Buildability | |
| Maintainability | |
| Performance | |
| JDBC | |
| JNDI | |
| EJB | |
| RMI | |
| JSP | |
| Servlets | |
| XML |
| Java Data Base Connectivity | |
| Establishes connections among applications and databases | |
| This may be direct or indirect | |
| Need to be able to administer database without involving the client |
| Java Naming and Directory Interface | |
| Provides a consistent interface to enterprise wide directories | |
| Serverside application that extends a web server | |
| Communicates using POST and GET | |
Remote Method Invocation - RMI
| A language for specifying object interfaces | |
| Uses a simplified type system | |
| The CORBA version interfaces multiple languages | |
| A basic CORBA OTS transaction monitor | |
| API for accessing mail servers |
| Communicating with message-oriented middleware | |
| Point-to-point domain | |
| Publish/subscribe domain | |
| XML | |
| Platform independent | |
| A number of standard tags have been developed to facilitate the transfer of information between companies | |
| <%@ page language="java" %> | |
| <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> | |
| <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> | |
| <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> | |
| <html> | |
| <head> | |
| <title>Submit example</title> | |
| </head> |
| <body> | |
| <h3>Example Submit Page</h3> | |
| <html:errors/> | |
| <html:form action="submit.do"> Last Name: <html:text property="lastName"/> | |
| <br> Address: <html:textarea property="address"/> | |
| <br> Sex: <html:radio property="sex" value="M"/>Male <html:radio property="sex" value="F"/>Female | |
| <br> Married: <html:checkbox property="married"/> | |
| <br> Age: <html:select property="age"> <html:option value="a">0-19</html:option> <html:option value="b">20-49</html:option> <html:option value="c">50-</html:option> </html:select> | |
| <br> <html:submit/> </html:form> </body> </html> | |
| Person | |
| FirstName String | |
| SecondName String | |
| Salary int | |
| ; |
| This is the so-called “middleware” | |
| Comparable to the Microsoft Transaction Server and components | |
| The “application server” provides/ or is a bean container | |
| The J2EE security model lets you configure a Web component or | |
| enterprise bean so that system resources are accessed only by | |
| authorized users. | |
| The J2EE transaction model lets you specify relationships among | |
| methods that make up a single transaction so that all methods in one | |
| transaction are treated as a single unit. | |
| JNDI lookup services provide a unified interface to multiple naming | |
| and directory services in the enterprise so that application | |
| components can access naming and directory services. | |
| The J2EE remote connectivity model manages low-level | |
| communications between clients and enterprise beans. After an | |
| enterprise bean is created, a client invokes methods on it as if it were | |
| in the same virtual machine. |
| Any good database software supports a transaction model that provides | ||
| Read/write | ||
| Commit | ||
| Rollback | ||
| EJB uses Java SQL to talk to database | ||
| Database handles the actions | ||
| Trade-off: how often is data committed? | ||
| One bean asks whether a certain item is available. While that user makes up his mind, another bean asks the same question and quickly buys the bean. The first bean assumes that the item is still available and marks it as sold. | |
| EJB has locking capability. Can block access by others until commit or rollback ends the transaction |
| Beans | ||
| can not create threads | ||
| Can not access threads with java.io | ||
| Can not operate directly on sockets | ||
| Can not use AWT to interact with user | ||
| Only use parameter types allowed by RMI | ||
| Must supply a no argument constructor | ||
| CMP – container managed persistence | ||
| Beans are portable | ||
| Caching happens at an aggregated level | ||
| BMP – bean managed persistence | ||
| Beans are not as portable | ||
| Caching is local | ||
| An EJB is a set of Java classes and an XML file | |
| XML manifest locates resources that the bean will need | |
| Specifies services that the bean offers |