﻿<?xml-stylesheet type="text/xsl" href="../../../templates/doc.xsl"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">
<html 
	xmlns="http://www.w3.org/1999/xhtml" 
	xmlns:doc="http://www.lepus.org.uk/doc" 
	xmlns:classz="http://www.lepus.org.uk/classz" 
	xmlns:fopl="http://www.lepus.org.uk/fopl" 
	xml:lang="EN-GB" 
	xmlns:v="urn:schemas-microsoft-com:vml" 
	xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml">

<head>
	<link rel="stylesheet" type="text/css" href="../../../templates/doc.css" />
	<title>Enterprise JavaBeans in LePUS3</title>
	<meta http-equiv="Content-Style-Type" content="text/css" />
	<meta name="Author" content="Amnon H Eden" />
</head>


<body>


<h5><a href="../../index.xml">Sample specifications in LePUS3 and Class-Z:</a></h5>

<p class="pagetitle">Enterprise JavaBeans</p>

<div class="abstract">

	<p>This page demonstrates how to combine constants and variables
	<a href="http://lepus.org.uk/">LePUS3</a> to specify application frameworks</p>

<p><strong>Links</strong></p>

	<ul>
		<li><a href="../../../ref/legend/legend.xml">Legend: Key to LePUS3 and Class-Z Symbols</a></li>
		<li><a href="../../../ref/refman/refman.xml">LePUS3 &amp; Class-Z Reference Manual</a></li>
		<li><a href="../../../ref/companion/index.xml">The 'Gang of Four' Companion: Formal specification of design patterns in LePUS3 and 
		Class-Z</a></li>
	</ul>
	
</div>

<p>Application frameworks cannot be modelled in UML, only specific 
implementations thereof. But a framework is NOT an implementation: It is 
specific combination between existing, pre-fabricated class library and 
user-defined classes which must collaborate according to specific rules. In 
LePUS3 the problem is solved using <em>constants</em> vs. <em>
	variables</em>: Constants, <a href="../../../ref/legend/legend.xml">modelled 
as filled shapes</a>, represent the pre-fabricated class library whereas 
variables,
	<a href="../../../ref/legend/legend.xml">modelled as empty shapes</a>, 
represent the user-defined elements of the framework. To verify the framework 
using the
	<a href="http://ttp.essex.ac.uk/index.php?page=toolkit">TTP Toolkit</a>, 
simply assign (create a mapping) each variable to an element of your 
implementation.</p>
<p>Consider for example the following chart, modelling the following set of 
rules described in the documentation of Enterprise JavaBeans:</p>

<table class="chartandschema">
<tr>
	<td>
	<img class="chart" alt="Enterprise JavaBeans" src="ejb.gif" /></td>
</tr>
<tr>
	<th>
		Enterprise JavaBeans (<a href="../../../ref/legend/legend.xml">legend</a>)
	</th>
</tr>
</table>


<p><a href="http://java.sun.com/products/ejb/">Enterprise JavaBeans</a> is an 
application framework designed to support the rapid development of distributed 
enterprise applications. Monson-Haefel [<a href="http://oreilly.com/catalog/9780596002268/">2001</a>] 
describe some of the principles underlying the design of EJB applications as 
follows:</p>

<ul>
	<li>Every bean [class] obtains an EJBContext object, which is a reference to 
	the container [class]</li>
	<li> The home interface extends the ...javax.ejb.EJBHome interface </li>
	<li> A home [interface] may have many create() methods, &#8230; , each of which 
	must have corresponding ejbCreate() and ejbPostCreate() methods in the bean 
	class. The number and datatype of the arguments of each create() are left up 
	to the bean developer, but the return type must be the remote interface 
	datatype. </li>
	<li> When a create() method is invoked on the home interface, the container 
	delegates the invocation to the corresponding ejbCreate() and ejbPostCreate() 
	methods on the bean class. 
		</li>
	<li> An implementation for the bean&#8217;s home interface (&#8216;home implementation&#8217;) 
	is generated by the container. </li>
	<li> Remote interfaces are subclassed from the javax.ejb.EJBObject 
	interface. &#8230; For every remote interface there is an implementation class, a 
	business object that actually implements the business methods defined in the 
	remote interface. This is the bean class. </li>
</ul>


<p>These statements are modelled in the chart above.</p>


</body>
</html>
