22 June 2008

Simple Session Bean - Entity Bean

This example shows how is working and how is interaction
between Session Bean and Entity Bean

//Session bean - Converter
package ejb;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

@Stateless
public class ConverterBean implements ConverterLocal {

@PersistenceContext
private EntityManager em;

public void storeTransaction (int amount, int rate) {
EuroToDollar rec = new EuroToDollar();
rec.setAmount(amount);
rec.setRate(rate);
em.persist(rec);
}

public int EuroToDollar (int amount, int rate) {
this.storeTransaction(amount,rate);
return amount*rate;
}

public void persist (Object object) {
em.perisist (object);
}
}

---------------

//Entity Bean - EuroToDollar
package ejb;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GeneratedType;
import javax.peristence.ID;

@Entity
public class euroToDollar implements Serializable {
private int id;
private int amount;
private int rate;

public void setId(int id){
this.id = id
}

@Id
@GeneratedValue (strategy = GenerationType.AUTO)
public integer getId(){
return id;
}

public integer getAmount(){
return this.amount;
}

public integer setAmount(integer amount){
this.amount = amount;
}

public integer getRate(){
return this.rate;
}

public integer setRate(integer rate){
this.rate = rate;
}
}

21 June 2008

Simple JSP - Servlet - Session Bean

This example shows how is simple structure of JSP, Servlet, Session Bean and interaction among them.


-------------------------
// index.jsp
// here is simple html structure
form name="convert" action="convert" method="post"
input name="money" type="text"
input value="Submit" type="submit"
// close codes with simple html structure

-----------------

// servlet convert.class

import java.io.*;
import java.net.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.ejb.EJB;
import ejb.converterlocal;

public class convert extends HttpServlet {
@EJB
private converterLocal ConverterBean;
protected void processRequest (HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException

Printwriter out = response.getWriter();
String amount = request.getParameter("money");
Double amountMoney = new Double(amount);
double result = converterBean.euroToDollar(amountMoney.doubleValue());
out.println(result);
out.close;
}

--------------------------

// EJB session bean - ConverterLocal

package ejb;

import javax.ejb.Local;

@Local
public interface converterLocal {
double euroToDollar (double amount);
}

-------------------------

//EJB session bean - ConverterBean

package ejb;

import javax.ejb.stateless;

@Stateless
public class converterBean implements ejb.ConverterLocal {
double euroRate = 1,5;

public double euroToDollar (double amount){
return amount*euroRate;
}
}

These codes are not error checked so it is possible to face some small errors but all these errors are typing errors and easy to find. General srtucture of jsp-servlet-ejb is working.

15 June 2008

Comparison of Selected Business Process Modeling Tools


There are lots of BPM (Business Process Modeling) tools but each of them is looking to models from different perspective so selection process of the BPM programs is difficult. This resource includes selection criteria of BPM programs with three exampel which are Visual Architect, Borland Together and Bonapart. Each of them has different perspective, advantages, disadvantages, different tools and usage areas. This academic research will help to solve several questions on your mind. Download research

14 June 2008

Request document for software project proposal


This document is a example RFP document. It may help and be idea to create a RFP document. Download RFP

Real Estate J2EE software project final report


Here you can find simple project report that explain final status of a J2EE real estate project. Download report

01 June 2008

Erp consulting


ERP-Enterprise Resource Planning is core of all business processes in an enterprise. This system is difficult to install, manage and operate so requires broad knowledge. Most of the IT departments have not enough knowledge about ERP system, as a result of these, for migration to ERP system and operation of the ERP system enterprises require consultant who has experienced in this field. What does ERP consultant? What are they doing? These are important questions and in this research all these questions are answered.
For English version of the research
For German version of the research