- Author: Sébastien Mosser mosser@i3s.unice.fr
- Reviewer: Anne-Marie Déry pinna@polytech.unice.fr
- Version: 02.2016
- Continuous integration status:
This case study is used to illustrate the different technologies involved in the Introduction to Software Architecture course given at Polytech Nice - Sophia Antipolis at the graduate level. This demonstration code requires the following software to run properly:
- Build & J2E environment configuration: Maven 3
- J2E implementation language: Java 8
- .Net implementation language: Mono >3.12
The Cookie Factory (TCF) is a major bakery brand in the USA. The Cookie on Demand (CoD) system is an innovative service offered by TCF to its customer. They can order cookies online thanks to an application, and select when they'll pick-up their order in a given shop. The CoD system ensures to TCF's happy customers that they'll always retrieve their pre-paid warm cookies on time.
The software architecture to be developed in this document will rely on the following stack:
- Architecture
- Business components with EJB Sessions
- Exposing components as Web Services (SOAP)
- Consuming external Web Services (REST)
- Unit testing versus Integration testing
- Complete architecture overview
- Message interceptors to support the NTUI (Never Trust User Input) golden rule
- Making things persistent
- Web user interface using JSF
- Asynchronous Communication using Messages
- Conclusions
- Bonus: Using behavioural-driven development to model test scenarios
Important remark: one can notice that the persistence layer (aka the database) is almost the last step of this document. This is done on purpose. Databases are part of a given architecture, but must not be considered as the its essence. The essence of an architecture is the set of supported features, at the business level. Databases are in this context only a way (among others) to store data.
Technical Information:
- Setting up IntelliJ: How to setup IntelliJ
- Docker: a containerised version of TCF, ready to start.
- The
develop
branch (the default one) represents the system under development.- The
releases/v1.0
branch contains the code that implements the system without persistence; - The
releases/v2.0
branch contains the code that implements the system with a real persistence layer; - The
releases/v2.1
branch contains the code that implements asynchronous communications.
- The
- Issues can be submitted using the GitHub ticketing system
To compile the demonstration (j2e, .Net and client parts), simply run the compilation script. The first compilation can take (a lot of) time, considering that Maven will have to download all the java dependencies necessary to build and run the system (the application server weights 43Mb):
mosser@azrael $ ./buildAll.sh
To run the demonstration, first start the two servers in two different terminals, then start the remote client in a third one:
# J2E terminal (^C to stop)
mosser@azrael $ cd j2e
mosser@azrael j2e$ mvn tomee:run
# .Net terminal (return to stop)
mosser@azrael $ cd dotNet
mosser@azrael dotNet$ mono server.exe
# Remote Client (bye to stop)
mosser@azrael $ cd client
mosser@azrael client$ mvn exec:java
azrael:4A_ISA_TheCookieFactory mosser$ cloc j2e client dotNet
141 text files.
134 unique files.
18 files ignored.
github.com/AlDanial/cloc v 1.70 T=2.66 s (46.3 files/s, 2410.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 102 993 1370 3024
Maven 1 7 10 191
XML 7 21 0 166
C# 4 44 34 163
Markdown 3 71 0 152
XHTML 4 32 2 113
JSP 1 0 0 4
Bourne Shell 1 1 0 2
-------------------------------------------------------------------------------
SUM: 123 1169 1416 3815
-------------------------------------------------------------------------------