Jul 10

Introduction

We’ve decided to make a java web application using database via MVC pattern.  To make a web application we use a glassfish server and primefaces.

Project Specification

Non functional:

– Availability.

– Recoverability.

– Maintainability.

 

Solution Design

Program Manual

Data Structures we used is an arraylist. It inherits AbstractList class and implements List interface. Java ArrayList allows us to randomly access the list and others i.e. implementing operators, etc.

Create a new web application. Now we make a database by creating a new java asp entity from database, we uses the model view controller file via mysql. The files made are in xhtml for the web. And it makes the packages for the navigating pages and the other for making the CRUD function.

The WEB-INF folder divides into the faces-config, glassfish-resources and web.xml the main requirements for running the program.  The games folder is in xhtml files as the algorithm explains the CRUD function when we click the links on the web.

Next, we go through the packages where is the main control of the program. First we go to the database.model package. First we make the abstract facade class. We import lists, validation, xml and the persistence so that it can create and remove persistent entity instances, to find entities by their primary key, and to query over entities.

The Games file shows the id name price and quantity by using set() and get() function to make the list. Implement serializable so that it can be saved to a database or transferred over a network. The @NamedQueries shows the command of the database for reading the database. For the overriding method, hashCode() Returns a hash code value for the object for the tables. And for toString() function the non string function are automatically converted to string.

The GamesController describes the selected lists when clicking on one of them. As from the previous, we implement serializable so it can save the database. Here we import jsfutil and pagination helper so that we can go navigate page by page. We make the Games, DataModel, gamesfacade, paginationhelper class private. TThen we make another class as static GamesControllerConvert by implementing converter so that it can convert to string. In the GamesFacade package we extend from the abstract class so it controls the entity manager by using inheritance.

We have the database.model.util. In the JsfUtil file, we import the javax faces and make the class abstract. The FacesContext represents all of the contextual information associated with processing an incoming request, and creating the corresponding response for the database.

Solution

 

 

 

 

 

 

 

References: https://www.youtube.com/watch?v=q-CzqROtoko Video Demo: https://drive.google.com/file/d/1-08wZb1lomLDlSpnKVpvReS0FGQ30oxo/view?usp=sharing Git link: https://github.com/alfir3dz1/programminglanguagesfinal

 

Members:

Alfi – 2101693574

Jason – 2101693510

Tama –  2101710920

Comments are closed.