A Report On Java Bean Enterprise Computer Science Essay

Published:

This report represents a sample Java bean enterprise application that used to deal with four entities. In this application we are going to implement the application that deal with student and library in this application the student they can borrow books from library , the student will have limit to borrow books and specific period for keeping book and all this operation will act in session bean and more detail will explain later on . In our application contain four entities as I mentioned before and those entities such as student, library, order, account, that was the basic of our applications and we have four session beans two stateless and two statefull .

This session beans are useful for describing interaction between other beans and it can be implementing particular tasks, and this session it can access data also it can use for read , insert and update in .

Details

Lady using a tablet
Lady using a tablet

Professional

Essay Writers

Lady Using Tablet

Get your grade
or your money back

using our Essay Writing Service!

Essay Writing Service

This application implements the Student and Library entities that are part of the main Java EE application. The four entity are represent as tables in database and we will deal with this data in our system by using some function of session beans.

As we mentioned before we have four entities bean and this entities take place in our application and they are in main business domain . . In our application we have three packages. The first package is com .university .domain. this package has four entities which are Account ,book ,student ,studentDetail the second one is com .university .client . which has one class LibarayClient the third one is com .university .bean .this package include ten classes which are two stateful and three stateless and two remote

All this details will illustrate in diagram below

The Bean Classes:

The entities bean are declared with @javax.persistence.Entity and the tables in the entity are declared with @javax.persistence.Table . The @Table annotation manages EJB container to place the table in which database table should map. @Entity annotation tells Persistence provider that this is an entity class that mapped to a database and this will be managed by an EntityManager which has the ability to manage data in the container .this entities bean are implement by java.io.Serializable. this annotation allows the bean classes to be used as the parameters and return values of the remote interface method of the session bean.

The Student Bean Class:

The Student bean class has three properties: Student number , student name and student address . all these element in this entity bean can be accessed by get and set methods. By this methods we can access any element in this entity . Also they can be accessed directly through the beans fields. In this entity we set no as primary key for this table and this no is unique in this entity .Student entity has relation one to many with book entity and that means student can have many books but book belong to one student.

The Book entity bean class::

The book bean class has three properties: Book id ,book name and book value . these element in this entity bean can be accessed by get and set methods. Id element represent as primary key of this entity and we can define this entity by this primary key because it is unique , this entity has many to one relationship with student entity that means many books they can be for one student .

The Student address entity bean class:

The Student address bean class has four properties: Address id , address1 , address2 , postcode . the element in this entity bean can be accessed by get and set methods. Id element represent as primary key of this entity and we can define this entity by this primary key because it is unique, this entity has one to one relationship with student entity that means each address is belong to one student .

The Loan entity bean class::

We create is entity by using @entity annoutation to define it as entity ,and we use @Table annotation to tell EJB container which database table should map.The loan bean class has two properties: Loan id ,loan size . these element in this entity bean can be accessed by get and set methods. Id element represent as primary key of this entity and we can define this entity by this primary key because it is unique and we use @GeneratedValue to generate id automatically, this entity has one to many relationship with student entity that means each loan will be for one student , and it has other relationship with books and this relationship is one to many . in this entity we declare two array list one for books and one for student and those arrays will hold the whole object of student and books , and then we can deal with this object much easer.

Session beans

Lady using a tablet
Lady using a tablet

Comprehensive

Writing Services

Lady Using Tablet

Plagiarism-free
Always on Time

Marked to Standard

Order Now

The session bean has been created in this application which represent in interface to interact with the university application . and the business logic of this session bean is to loan books from library by student .Every session bean has interface which contains the declaration for methods in this sessions and also we use this interface in client application to allow us to access to the procedure that session bean can do.

Stateless session bean . this session represented by methods and this beans does not maintains state from one method invocation to the next .when we invoke a method on stateless session bean , it will implement the method and returns the result .

Stateful session bean is an extension of the client application. it performs tasks on acting of a client and this beans dose maintains conversational state because it represents a continuing conversation between the stateful session beans and the client , and this beans can write and read data from this conversational state .

In our application we have three stateless session bean and two stateful session bean .

The sessions of Stateless type which are:

In this application we declare two stateless session bean which are BookBean and StudentBean .

BookBean session bean in this bean we created remote interface class for it and this remote interface contain some methods which manipulate books entity by using createBook() and findBook() .in BookBean session bean we have some methods to process the operation of client .there are two methods in this class which are :

public void createBook(Book book)

{

em.persist(book);

}

This method what it does is to create new book for client and this operation will manage by entity manager which has the ability to change into table we had created

public Book findBook(int no){

return em.find(Book.class, no);

}

}

This method what it does is to lookup for specific object using primary key of that table , and entity manager can do that instead of do it manually .

The IssueBean session receive object type of Laon entity and after that get the number of books for student and compare it with the limit number that can student borrow and then show message depends on the case if student if he can not borrow or display the number of books that he has after this procedure .

The sessions of Statelful type which are:

The SizeBean session is very simple all what it do about receive object type of loan for student want to borrow book and determine the due date for him by use new.util.Date which allow user to enter the date and after modify the date return the object loan so it access to database and set the new due date for this student.

The TotalValueBean session deal with student entity and book entity it get the collection of book for one student and every time check the collection for this student add one at the end will return the number of books for this student.

Conclusion

In our application we used primary key to distinguish and unique column by that each entity has primarily key .

In this application we used different types of relationship such as one to many between student and loan entity , that means student can borrow more than one book and books can not be for many student in this relation is unidirectional .

And other relations are represent in diagram as below

Contribution made by my group members

The group members worked very hard and they are very nice people to work with because they are really serious of what they are doing and they like to work as group. Also they helped me a lot to pass some problems when I was working in my parts and now I will talk about each member . each one has contributed in this project by 50% for each .

What I have gained from this project

By this project we have learnt a lot of things which were very important to develop our software's knowledge especially in javabean; we have learned by this project and I have improved my knowledge in this way. Maybe to know everything in one time is impossible but to have idea about many things that is possible and I would like to work on this way because is interesting and you can work iteratively and to improve your knowledge in programming. I think if we have plenty time to work on this application we can have something much better and I hope we reach the main point in this project.

Lady using a tablet
Lady using a tablet

This Essay is

a Student's Work

Lady Using Tablet

This essay has been submitted by a student. This is not an example of the work written by our professional essay writers.

Examples of our work

Wireless networks have had a significant impact on the world as far back as World War II. Through the use of wireless networks, information could be sent overseas or behind enemy lines easily, efficiently and more reliably. Since then, wireless networks have continued to develop and their uses have grown significantly. Cellular phones are part of huge wireless network systems. People use these phones daily to communicate with one another. Sending information overseas is possible through wireless network systems using satellites and other signals to communicate across the world. Emergency services such as the police department utilize wireless networks to communicate important information quickly. People and businesses use wireless networks to send and share data quickly whether it be in a small office building or across the world.

Another important use for wireless networks is as an inexpensive and rapid way to be connected to the Internet in countries and regions where the telecom infrastructure is poor or there is a lack of resources, as in most developing countries.

Compatibility issues also arise when dealing with wireless networks. Different components not made by the same company may not work together, or might require extra work to fix these issues. Wireless networks are typically slower than those that are directly connected through an Ethernet cable.

A wireless network is more vulnerable, because anyone can try to break into a network broadcasting a signal. Many networks offer WEP - Wired Equivalent Privacy - security systems which have been found to be vulnerable to intrusion. Though WEP does block some intruders, the security problems have caused some businesses to stick with wired networks until security can be improved. Another type of security for wireless networks is WPA - Wi-Fi Protected Access. WPA provides more security to wireless networks than a WEP security set up. The use of firewalls will help with security breaches which can help to fix security problems in some wireless networks that are more vulnerable.