The Place of JSF-related Tools and Technologies in Business

HarbSec
11 min readJul 14, 2021

(University Coursework from 2018)

This essay will have three parts. Using the web application for the Society of Epicures as the case study, the first section will explain how JSF technology works to fulfil our project requirements. Analysis and design methods will be shown here too. The second section will justify using these analysis and design methods for this project. Finally, the essay will discuss the use of frameworks, bean technology and the capabilities of a server in the building of web applications.

How JSF Technology Works in the Construction of Software

The official Oracle documentation states, “JavaServer Faces technology is a server-side user interface component framework for Java technology-based web applications …” (Java, 2010). It goes on to describe a JSF application as including a set of presentation pages and backing beans.

The JSF framework utilizes the Model-View-Controller architectural pattern (IBM Knowledge Center, n.d.). The ‘model’ part of this pattern performs the heart of the application. The ‘view’ part is the output, visually representing the model. The ‘controller’ is the input part which relays commands from the user (or other controlling component) to the model (Savitch, 2016).

Figure 1. Model-View-Controller (Codequs 2018).

Figure 1. shows a simple diagram of this model, referenced from Codequs (2018).

Figure 1.A. Java Server Faces (Derby, 2017).

Figure 1.A shows a more developed diagram of JSF’s architecture including a configuration file, and the managed beans which take requests from the servlet, rendering them to the relevant web page (Derby, 2017).

The Society of Epicures had a static website which required a dynamic section showing details of regular dining events. Typically a user accesses the website and navigates to the events page which would display the most recent dining event.

Figure 2. below shows a use case script for this occurrence.

The use case script for this situation would be as follows:

Title: View Event

Actor: Society Member

Use case begins: Member accesses website to view event information.

Use case ends: Member views event information.

Figure 2. Use case script

This use case script shows a sequence in which the member of the Epicurean Society accesses the website page, navigating to the Events page, which sends a request to the managed bean. The managed bean then retrieves event information from the Events database before sending the information to the Events page which displays it.

Figure 3. below shows a use case model for this occurrence.

Figure 3. Use Case Model.

The use case shows the events that take place during this occurrence. It shows the instigator of the occurrence as being the society member. They may access the index page, navigate to a secondary page and view event details. These actions occur within the system of the web application which is highlighted by the square. The server sends the requested data to the managed bean. As the member and the server are both outside the system, they are positioned outside the square.

Figure 4. below shows a class model for this occurrence.

Figure 4. Class Model

The class models shows all classes their names, attributes and operations involved in this occurrence. For example the “Managed bean” class has a filename and retrieves the data from the database before sending that data to the secondary web page. Blue text shows the multiplicity between classes, such as how many users may correspond to the index page. There may be many users but there can only be one index page. The software will not allow many-to-one to be written, so only one-to-many is written, along with the direction of multiplicity.

Figure 5. below shows a state transition diagram for this occurrence, showing the changing state of the Events page of the application.

Figure 5. State Transition Diagram

The state transition diagram shows changing states of the Events page and the transitional events which cause its state to change. The page starts off showing the event from the previous month but then the current month’s event takes place. This is the transitional event, which alters the state of the Events page. It now shows the event of this month.

Analysis and Design Approaches for the Epicurean Society Website

The analysis and design approaches used in this project are the use case class diagram and the state transition diagram. All models were produced using UML, which stands for “Unified Modelling Language”. It is a set of rules and semantics to show the structure and logic of a system and is currently managed by the OMG (Object Management Group) (Avison & Fitzgerald, 2006). Petre (2013, p2), states that UML is often described as “the lingua franca of software engineering”. In the study which involved interviews with fifty software engineers in different companies, Petre found three main benefits of using UML. It is comprehensible and fit for the practitioner’s purpose, able to capture structure at certain levels, and thirdly able to make behaviour explicit by showing a sequence of actions.

Cockburn (2009), provides advantages of the use case. The list of goal names provides the shortest summary of what the system contributes. It could show a customer that every required function and variant of it has been thought of including ‘extends’ situations which would waste programming time if not investigated at this stage. When applied to our web application, the summary of what the system does is concise and is useful for a developer.

Avison & Fitzgerald (2006) describe class diagrams as being used for modelling static structure in UML. In this type of model, a class is represented as a rectangle with three sections. The top provides the class name, the middle shows the attributes and the lowest shows the operations. This is useful to any developer needing to understand the classes involved in the specific function being investigated in our web application.

A class diagram models the static view of an application. It shows the responsibilities of a system, assists with forward and reverse engineering, and provides a base for further diagrams. It is the only type of UML diagram which can be directly mapped with object-oriented engineering, being the most popular UML diagram amongst coders (Tutorials Point, n.d.). This contrasts with a state transition diagram.

A state transition diagram is used to show the state of a system and can refer to physical systems such as a door being open and closed, or a more abstract example such as a bank being in an overdrawn state or having money present. A transitional event takes place to change the state of the system. In the banking example, the transitional event may be the withdrawal of money (Teach-ICT, n.d.).

As Rouse (2007) puts it “A state diagram, also called a state machine diagram or state chart diagram, is an illustration of the states an object can attain as well as the transitions between those states in the Unified Modeling Language (UML). In this context, a state defines a stage in the evolution or behavior of an object…”. It is important to note that a ‘state transition diagram’ is just one type of ‘state diagram’.

State-transition diagrams are useful for describing behavior of classes in use cases. They are also useful for testing and tracing applications from functions back to their requirements (Copeland, 2003).

The Pros and Cons of Building Systems based on Frameworks, Bean Technology and the Capabilities of an Application Server.

Whereas JSF is just one specific framework a developer can use, this section will discuss strengths and weaknesses of frameworks more generally. Next, bean technology and application servers, will be discussed. Schlesselman (2018) mentions using front-end web frameworks, although the points raised are applicable to all frameworks. Saying they are beneficial due to being quick and easy to get started and having help readily available via documentation. The downsides he mentions are that frameworks can be too ‘opinionated’ making customizations and features difficult to add in, software updates to the framework can introduce issues into the application, and one-size-fits-all frameworks can have an excessively large footprint with lots of bloat.

Selvakumar (2014) includes security as both a pro and a con. As a pro, if a security flaw is found with the framework, the developer can alert the framework team to fix it. On the downside, the code is public so it can be analysed by malicious users who seek to exploit it. Another downside is the ‘limitation’ of the frameworks — the same as what Schlesselman called ‘opinionated’. Both agree that selection of the most suitable framework from the start, can alleviate issues further down the road.

Farrell (2018) comments that JSF’s main benefit is the quantity of component frameworks available which let developers who lack front-end skills get started quickly. He goes on to say that it is well-documented. However he also list the downsides that it can be difficult to fulfil more complex requirements as the request/response model is more abstract. Furthermore, he views JSF as a “legacy framework” which has “fallen out of favour”, comparing it to Javascript frameworks. He describes Javascript frameworks as having short life spans at risk of becoming obsolete — recognizing JSF’s age as being a strong point in this respect.

Mckenzie (2016) describes JSF as having a steep learning curve, if a project with more than the simplest complexity is chosen. This means that very few developers understand how to troubleshoot issues. This view offers a contrast to the notion that JSF is well documented, and hence easy to troubleshoot. He also argues that JSF makes the simplest of tasks difficult, reporting that components may need to be specifically created out of another language, javascript, to meet requirements. JSF’s lack of flexibility is also criticized. Mckenzie provides an example in which the JSF error message reporting framework was being used and an additional fifth alerting level was required. JSF could not accommodate this, causing that requirement to be dropped, to meet a deadline. This reinforces the need to select frameworks with the correct capabilities beforehand.

A key part of JSF is the managed beans. Javapedia.net (n.d.) provides three disadvantages of javabeans. Firstly the javabean will be in an invalid state halfway through its construction. Secondly, javabeans cannot make a class immutable. Thirdly javabeans allow inconsistency and mutability. Another aspect of JSF may be the use of application servers.

Wolff (2014), argues against the use of java application servers, for five main reasons in his view. Firstly, they are complex and must be properly installed and configured. The configuration must also match the application. This complexity is further discussed by Wolff and was demonstrated in the author’s own experience of trying to connect our web application to the Glassfish server, both via a Netbeans component, and via a third-party service called Massivegrid. On both occasions, instructions were followed up to a point where they could no longer be followed. In Netbeans, the author navigated to a folder where a file was expected to be, and it was not there. This made it impossible to progress to the next stage. Documentation did not address this issue.

The author’s supervisor was contacted and did recognize that it would potentially require a reconfiguration of the author’s computer to rectify this issue, despite no mistakes having been made. Working remotely, this was not realistic. The supervisor recommended trying a trial version of Massivegrid and connecting to Glassfish that way. An entirely different set of instructions were followed to set up a blank database and make changes to it via the connection. This would show that the connection was successful. After following instructions to deploy some executable code to the database, it was checked and had not changed. This time, the support services were contacted but the staff insisted there was nothing wrong with the connection and recommended another attempt. Further attempts were unsuccessful, and the deadline passed before this task could be completed. This leads onto the issue of serverless architecture.

With the increasing popularity of serverless architecture, Maruti Techlabs (2017) explain some disadvantages of this trend. They mainly revolve around the loss of control to a third-party vendor of this service, security concerns and potential vendor lock-in. Forced API upgrades can lead to loss of functionality. Debugging a distributed system is difficult without access to high quality metrics tools, and the customer is dependent on the vendor to possess these. This appraisal of the serverless architecture does show that it is not necessarily replacing the use of application servers, as it too has its drawbacks.

This essay has outlined the use of JSF in a real project, providing support and criticism of it. Some arguments are that the framework is being superseded by others or systems which do not depend on servers. On the other hand, it is regarded as well documented and stable due to its lifespan so far. Monus (2018), has listed JSF as one of the 17 popular java frameworks for 2019. It is described as a gold standard of the JCP (Java Community Process), indicating that, for the time being, JSF is still in the running as a solid framework of choice for many developers.

References

Avison, D. & Fitzgerald, G. (2006), Information Systems Development, 4th Ed, Maidenhead: McGraw-Hill Education.

Cockburn, A. (2008) Why I still use use cases. [Online] Available from http://alistair.cockburn.us/Why+I+still+use+use+cases (At the time of writing, this website is under reconstruction and redirects to https://alistair.cockburn.us/coming-soon/) The article is however available from http://www.inf.puc-rio.br/~ivan/INF1013/NotasAula/Why%20I%20Still%20Use%20Use%20Cases.pdf [Accessed: 23/12/2018].

Codequs. (2018) Understanding MVC (Model-View-Controller) with PHP. [Online] Available from https://www.youtube.com/watch?v=y4v2Rl4mVwI [Accessed: 27/12/18]).

Copeland, L. (2003) State-Transition Diagrams, Testing UML Models, Part 4. [Online] Available from https://www.stickyminds.com/article/state-transition-diagrams [Accessed: 23/12/18].

Derby, C. (2017) JSF Tutorial #9 — Java Server Faces Tutorial (JSF 2.2) — JSF Behind the Scenes [Online] Available from https://www.youtube.com/watch?v=wQMCruLSuZE [Accessed: 30/12/18]

Farrell, M. (2018) Would you use JSF for your next project? [Online] Available from https://www.javabullets.com/is-jsf-still-relevant/ [Accessed: 19/12/2018]).

IBM Knowledge Center. (n.d.) Model-view-controller architecture [Online] Available from https://www.ibm.com/support/knowledgecenter/SSRTLW_9.6.1/com.ibm.etools.jsf.doc/topics/cmvc.html [Accessed: 27/12/18])

Java. (2010) The Java EE 5 Tutorial [Online] Available from https://docs.oracle.com/javaee/5/tutorial/doc/bnaph.html [Accessed: 12/12/18])

Javapedia.net. (n.d.) Design Patterns, Disadvantages of Java beans pattern [Online] Available from https://www.javapedia.net/Design-Patterns/1597 [Accessed: 26/12/18]

Maruti Techlabs. (2017) What is Serverless Architecture? What are its criticisms and drawbacks? [Online] Available from https://medium.com/@MarutiTech/what-is-serverless-architecture-what-are-its-criticisms-and-drawbacks-928659f9899a [Accessed: 22/12/18]

Mckenzie, C. (2016) Five drawbacks to choosing JSF as your web application framework [Online] Available from https://www.theserverside.com/feature/Five-drawbacks-to-choosing-JSF-as-your-web-application-framework [Accessed: 19/12/2018])

Monus, A. (2018) 17 Popular Java Frameworks [2018 edition]: Pros, cons, and more [Online] Jul 4th 2018. Available from https://raygun.com/blog/popular-java-frameworks/ [Accessed: 26th December 2018]

Petre, M. (2013) UML in practice. 2013 International Conference on Software Engineering [Online] p722–731, Available from: http://oro.open.ac.uk/35805/8/UML%20in%20practice%208.pdf [Accessed: 23rd January 2012]

Rouse, M. (2007) State diagram (state machine diagram or statechart diagram) [Online] Available from https://searchmicroservices.techtarget.com/definition/state-diagram-state-machine-diagram-or-statechart-diagram [Accessed: 23/12/18]

Savitch, W. (2016) Absolute Java. 6th Ed. Harlow: Pearson Education.

Schlesselman, D. (2018) Pros & Cons of Front-End Frameworks [Online] April 20th 2018. Available from https://envisionitagency.com/blog/2018/04/pros-cons-front-end-web-frameworks/ [Accessed: 16th December 18]

Selvakumar. (2014) Pros And Cons Of Using Frameworks [Online] Available from https://www.webdefy.com/pros-and-cons-using-frameworks/ [Accessed: 16/12/18])

Teach-ICT. (n.d.) 6. State Transition Diagrams [Online] Available from http://www.teach-ict.com/as_a2_ict_new/ocr/A2_G063/331_systems_cycle/analysis_tools/miniweb/pg6.htm [Accessed: 23/12/18])

Tutorials Point. (n.d.) UML — Class Diagram [Online] Available from https://www.tutorialspoint.com/uml/uml_class_diagram.htm [Accessed: 23/12/18])

Wolff, E. (2014) Part II — Deployment, monitoring and microservices, Java application servers are dead! [Online] Available from https://jaxenter.com/java-application-servers-dead-112186.html [Accessed: 22/12/18]

--

--