collet / 4A_ISA_TheCookieFactory

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The Cookie Factory (ISA Case study)

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

Product vision

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:

Chapters

  1. Architecture
  2. Business components with EJB Sessions
  3. Exposing components as Web Services (SOAP)
  4. Consuming external Web Services (REST)
  5. Unit testing versus Integration testing
  6. Complete architecture overview
  7. Message interceptors to support the NTUI (Never Trust User Input) golden rule
  8. Making things persistent
  9. Web user interface using JSF
  10. Asynchronous Communication using Messages
  11. Conclusions
  12. 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:

How to use this repository

  • 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.
  • Issues can be submitted using the GitHub ticketing system

Compilation & Execution

Requirements

  • Java 8
  • Maven (>= 3.6.1)
  • Mono
    • Tested with version 6.12

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

Code information

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
-------------------------------------------------------------------------------

Technological Stack

About

License:GNU Lesser General Public License v3.0


Languages

Language:Java 83.7%Language:C# 5.9%Language:HTML 4.6%Language:Shell 2.5%Language:Dockerfile 1.6%Language:Gherkin 1.6%