• This repository has been archived on 08/Oct/2019
  • Stars
    star
    247
  • Rank 164,117 (Top 4 %)
  • Language
    Java
  • License
    Other
  • Created over 7 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Applied domain-driven design blueprints for Java EE
================================================================================                            
                              Cargo Tracker
            Applied Domain-Driven Design Blue Prints for Java EE
================================================================================

Overview
========
The project demonstrates how you can develop applications with the Java EE 
platform using widely adopted architectural best practices like Domain-Driven 
Design (DDD), TDD and agile. The project is directly based on the well known 
original Java DDD sample (http://dddsample.sourceforge.net) application 
developed by DDD pioneer Eric Evans' company Domain Language and the Swedish 
software consulting company Citerus. The cargo example actually comes from 
Eric Evans' seminal book on DDD. The original application is written in Spring,
Hibernate and Jetty whereas the application is build entirely on Java EE 7 and
GlassFish 4.  It also supports WildFly 8.

The application is an end-to-end system for keeping track of shipping cargo. It 
has several interfaces described in the following sections.

For further details on the project, please visit:
https://github.com/javaee/cargotracker

Getting Started
===============
The project site has detailed information on how to get started: 
https://java.net/projects/cargotracker/pages/Home, especially with NetBeans:
https://java.net/projects/cargotracker/pages/NetBeans.

The simplest steps are the following (no IDE required):

* Get the project source code: https://java.net/projects/cargotracker/downloads
* As long as you have Maven set up, navigate to the project source root and 
  type: mvn package cargo:run
* To run with WildFly 8x, type: mvn -Pwildfly package cargo:run
* Go to http://localhost:8080/cargo-tracker

To set up in NetBeans, follow these steps:

* Set up JDK 7+, NetBeans 7.3+ and GlassFish 4+ 
  (preferably GlassFish 4.1+ and NetBeans 8.0.1+).
* Open the source code directory in NetBeans - it's just a Maven project, 
  NetBeans will do the rest for you. As noted in the site instructions on
  NetBeans, you may get a few spurious errors due to reported NetBeans bugs.
  Just ignore them and proceed with clean/building the application.
* After the project is built (which will take a while the very first time as 
  Maven downloads dependencies), simply run it via GlassFish 4.
  
It's best to use Chrome for the application since it has the best support for 
HTML 5 forms, but any HTML 5 capable browser is fine. There are some known 
issues due to reported GlassFish 4 bugs - please read the Known Issues section 
below.

Exploring the Application
=========================
After the application runs, it will be available at: 
http://localhost:8080/cargo-tracker/. Under the hood, the application uses a 
number of Java EE (and Java EE 7) features including JSF 2.2, CDI, EJB 3.2, 
JPA 2.1, JAX-RS 2, WebSocket, JSON-P, Bean Validation 1.1 and JMS 2.

There are several web interfaces, REST interfaces and a file system scanning
interface. It's probably best to start exploring the interfaces in the rough
order below.

The tracking interface let's you track the status of cargo and is
intended for the general public. Try entering a tracking ID like ABC123 (the 
application is pre-populated with some sample data).

The administrative interface is intended for the shipping company that manages
cargo. The landing page of the interface is a dashboard providing an overall 
view of registered cargo. The dashboard will update automatically when cargo
is handled (described below). You can book cargo using the booking interface.
One cargo is booked, you can route it. When you initiate a routing request,
the system will determine routes that might work for the cargo. Once you select
a route, the cargo will be ready to process handling events at the port. You can
also change the destination for cargo if needed or track cargo.

The Incident Logging interface is intended for port personnel registering what 
happened to cargo. The interface is primarily intended for mobile devices, but
you can use it via a desktop browser. The interface is accessible at:
http://localhost:8080/cargo-tracker/incident-logger/. For convenience, you
could use a mobile emulator instead of an actual mobile device. On Windows,
you can use Microsoft WebMatrix for device emulation. Generally speaking cargo
goes though these events:

* It's received at the origin port.
* It's loaded and unloaded onto voyages on it's itinerary.
* It's claimed at it's destination port.
* It may go through customs at arbitrary points.

While filling out the event registration form, it's best to have the itinerary 
handy. You can access the itinerary for registered cargo via the admin interface.
As you register handling events, the administrative dashboard will be 
automatically updated in real time without a page refresh in addition to cargo 
state. The cargo handling is done via JMS for scalability and the event 
notification to the system happens via the CDI event bus and WebSocket, so you 
will see a visible delay of a few seconds after registering the event for the
dashboard to update. While using the incident logger, note that only the load 
and unload events require as associated voyage (entering an unnecessary voyage 
for other events will result in an  error).

You should also explore the file system based bulk event registration interface. 
It reads files under /tmp/uploads. The files are just CSV files. A sample CSV
file is available under src/main/resources/handling_events.csv. Sucessfully 
processed entries are archived under /tmp/archive. Any failed records are 
archived under /tmp/failed. Just like the mobile interface, processing events
in bulk will also cause the dashboard to automatically update.

Don't worry about making mistakes. The application is intended to be fairly 
error tolerant. If you do come across issues, you should report them. Please
see the Getting Involved section on how to do so.

NOTE: All data entered is wiped upon application restart, so you can start from 
a blank slate easily if needed.

You can also use the soapUI scripts included in the source code to explore the 
REST interfaces as well as the numerous unit tests covering the code base 
generally.

Exploring the Code
==================
As mentioned earlier, the real point of the application is demonstrating how to 
create well architected, effective Java EE applications. To that end, once you 
have gotten some familiarity with the application functionality the next thing 
to do is to dig right into the code.

DDD is a key aspect of the architecture, so it's important to get at least a 
working understanding of DDD. As the name implies, Domain-Driven Design is an 
approach to software design and development that focuses on the core domain and 
domain logic.

We have a brief overview of DDD specifically as it relates to Java EE on the 
project site: https://java.net/projects/cargotracker/pages/Home. There's also a 
resources page that you should take a look at: 
https://java.net/projects/cargotracker/pages/Resources. The project site has 
pages dedicated to explaining the core constructs of DDD and how they are 
implemented in the application using Java EE: 
https://java.net/projects/cargotracker/pages/Characterization as well as the DDD
layers in the application: https://java.net/projects/cargotracker/pages/Layers.

For the most part, it's fine if you are new to Java EE. As long as you have a
basic understanding of server-side applications, the resources referenced above
and the code should be good enough to get started. For learning Java EE further,
we have recommended a few links in the resources section of the project site. Of 
course, the ideal user of the project is someone who has a basic working 
understanding both Java EE and DDD. Though it's not our goal to become a kitchen 
sink example for demonstrating the vast amount of APIs and features in Java EE,
we do use a very representative set. You'll find that you'll learn a fair amount
by simply digging into the code to see how things are implemented.

Known Issues
============
There are no known issues while running on GlassFish 4.1. For previous versions
you might run into the following issues:

* If you restart the application a few times, you will run into a GlassFish 4 
  bug (https://java.net/jira/browse/GLASSFISH-20616) causing a spurious 
  deployment failure. While the problem can be annoying, it's harmless. Just re-
  run the application (make sure to completely shut down GlassFish first).
* You will see some spurious JSF warnings on some pages due to a GlassFish 
  4/Mojarra bug (https://java.net/jira/browse/GLASSFISH-20244). The error is 
  harmless and can be ignored.
* Sometimes when GlassFish is not shutdown correctly, the Derby database that 
  the application uses get's corrupted, resulting is strange JDBC errors. If 
  this occurs, you will need to stop the application and clean the database. You 
  can do this by simply removing \temp\cargo-tracker-database from the file 
  system and restarting the application.

Getting Involved
================
Cargo Tracker is an open source project hosted on java.net. We would welcome any 
and all contributions.

The project mailing lists are here: https://java.net/projects/cargotracker/lists
The JIRA issue tracker is here: http://java.net/jira/browse/CARGOTRACKER

You can also send an email to [email protected] with any questions, 
concerns or suggestions.

More Repositories

1

jersey

This is no longer the active Jersey repository. Please see the README.md
Java
2,863
star
2

glassfish

The Open Source Java EE Reference Implementation
Java
763
star
3

javamail

JavaMail API Reference Implementation
Java
577
star
4

javaee-spec

Java EE Platform Specification
HTML
389
star
5

tutorial-examples

Java
313
star
6

servlet-spec

The API and Issue Tracker for the JCP Standard Java Servlet Specification
Java
253
star
7

grizzly

Writing scalable server applications in the Javaβ„’ programming language has always been difficult. Before the advent of the Java New I/O API (NIO), thread management issues made it impossible for a server to scale to thousands of users. The Grizzly NIO framework has been designed to help developers to take advantage of the Javaβ„’ NIO API.
Java
222
star
8

tutorial

The Java EE Tutorial
CSS
220
star
9

jaxb-v2

Java
210
star
10

javaee.github.io

Java Enterprise Edition Development
SCSS
207
star
11

jax-rs-api

JAX-RS API Source Code
Java
192
star
12

tyrus

Tyrus - Reference implementation of Java API for WebSocket - JSR 356
Java
172
star
13

mojarra

PLEASE NOTE: This project has moved to Eclipse Foundation and will be archived under the JavaEE GitHub Organization. After Feb. 1, 2021, the new location will be github.com/javaee/mojarra. Mojarra - Oracle's implementation of the JavaServer Faces specification
Java
164
star
14

metro-jax-ws

Java
132
star
15

security-soteria

Java EE Security (JSR-375) Reference Implementation
Java
117
star
16

hk2

A light-weight and dynamic dependency injection framework
Java
112
star
17

jpa-spec

Java
90
star
18

glassfish-samples

GlassFish samples has been migrated to Eclipse Foundation https://github.com/eclipse-ee4j/glassfish-samples
Java
89
star
19

jsonp

Java API for JSON Processing (JSON-P)
Java
83
star
20

jax-rs-spec

JAX-RS Specification Sources
TeX
75
star
21

firstcup-examples

Java
56
star
22

jsonb-spec

Java API for JSON Binding (JSON-B)
Java
55
star
23

jstl-api

Java
46
star
24

javaserverfaces-spec

JavaServer(TM) Faces Specification web site
SCSS
43
star
25

javax.annotation

Repository for javax.annotation api
Java
42
star
26

jaxb-codemodel

CodeModel is a Java library for code generators. This content is migrated into JAXB RI. This is for legacy viewing only
Java
40
star
27

websocket-spec

Java API for WebSocket (JSR-356) defines a standard API for creating web socket applications.
TeX
38
star
28

javaee7-samples

javaee7-samples
Java
37
star
29

firstcup

First Cup of Java EE Tutorial
CSS
35
star
30

security-spec

Java EE Security (JSR-375) Specification
31
star
31

grizzly-ahc

The Grizzly Async Http Client (GAHC) library purpose is to allow Java applications to easily execute HTTP requests and asynchronously process the HTTP responses
Java
30
star
32

openmq

Java
29
star
33

security-examples

Examples demonstrating deficiencies in the current EE Security API, or demonstrating proposed EE Security API improvements.
Java
29
star
34

jersey-1.x

Jersey 1.x repository migrated to Git (synchronized with the Jersey 1.x Git repository on java.net).
Java
27
star
35

wadl

Web Application Description Language (WADL) project. This legacy project is available for review only
Java
26
star
36

batchlab

Batch API (JSR 352) Hands-on Lab
HTML
26
star
37

security-api

Java EE Security (JSR-375) API
Java
25
star
38

j1-hol

Java EE 8 Hands On Lab
Java
24
star
39

javaee-jsp-api

javaee-jsp-api
Java
22
star
40

jms-spec

Repository for the JMS specification, the JMS API source and the JMS specification website
Java
21
star
41

jersey-hol-sse-websocket

Hands-on-lab on using server-sent events and web socket with Jersey and Tyrus.
Java
21
star
42

security-proposals

Legacy scratch workspace for Java EE Security. Please check out Jakarta EE Security at the link below
Java
20
star
43

el-spec

Expression Language 3.0 specification, JSR341
Java
20
star
44

activation

Java
19
star
45

jaxb2-commons

JAXB Implementation project has been contributed to Eclipse Foundation. This repository is for legacy review only. Please refer to the Eclipse EE4J Metro project for the very latest
Java
17
star
46

javax.ejb

Repository for javax.ejb api. Issues at https://github.com/javaee/ejb-spec/issues
Java
15
star
47

jsr311

Legacy JAX-RS (JSR-311) spec. development. Please use the link below for the latest project details
Java
15
star
48

javahelp

javahelp
HTML
14
star
49

uel-ri

Legacy archive for Expression Language (JSR 341) Reference Implementation. Please browse to https://github.com/eclipse-ee4j/el-ri for current activity
Java
14
star
50

jax-rpc-ri

jax-rpc-ri
Java
11
star
51

jersey-old

Obsolete unmaintained mirror of Jersey 1.x SVN repository on jersey.java.net
Java
11
star
52

javax.transaction

Repository for javax.transaction api (JSR 907).
Java
11
star
53

jta-spec

Preliminary and non-final documentation for JTA Specification (JSR 907)
11
star
54

metro-jaxws-commons

Metro has been contributed to Eclipse Foundation. This repository is for legacy review only. Please refer to the Eclipse EE4J Metro project for the very latest
Java
10
star
55

metro

Metro has been contributed to Eclipse Foundation. Please use the link below to find the latest project
SCSS
10
star
56

javax.jms

Repository for javax.jms api, repackaged from jms-spec
Java
9
star
57

glassfish-corba

Formerly the home of GlassFish CORBA ORB. Please follow the link below for the current project page
Java
9
star
58

jaxb-spec

Formerly jsr222.java.net
Java
9
star
59

metro-wsit

Java
9
star
60

jersey-1.x-old

Read-only mirror of Jersey 1.x svn repository from jersey.java.net
Java
9
star
61

json-processing-spec

Legacy JSON Processing spec. Please use the link below to find the current JSON P project
HTML
8
star
62

jax-ws-spec

Java
8
star
63

javax.xml.soap

Repository for javax.xml.soap api
Java
8
star
64

grizzly-thrift

grizzly-thrift
Java
8
star
65

javadb

Java
7
star
66

jax-rs.github.io

legacy jax-rs website. Please use the link below for the latest
HTML
7
star
67

javax.jws

Repository for javax.jws api
Java
6
star
68

website-template

Common site template for Java EE related projects.
6
star
69

javax.interceptor

Repository for javax.interceptor api
Java
6
star
70

ejb-spec

See javax.ejb project for API. Contains legacy issues only.
6
star
71

jaxb-dtd-parser

Library for parsing XML DTDs
Java
6
star
72

interceptors-spec

interceptors-spec~interceptors-spec-repository
6
star
73

mvc-spec

This is a Read-Only mirror repository for JSR 371. For ongoing work, issue tracker and latest versions, go to https://github.com/jakartaee/mvc
Java
6
star
74

metro-policy

metro-policy
Java
5
star
75

grizzly-memcached

grizzly~memcached
Java
5
star
76

metro-saaj

Java
5
star
77

modularity-tools

modularity-tools
Java
5
star
78

jsf-extensions

JSF has been contributed to Eclipse Foundation and this repository is now called mojarra-jsf-extensions. Please follow the link below for the current repository
Java
5
star
79

schemas

The JCP-defined XML schemas for many Java EE specs.
JavaScript
5
star
80

shoal

Shoal Framework - For scalable dynamic clustering infrastructure to build fault tolerance, reliability and availability.
Java
5
star
81

logging-annotation-processor

A Java annotation processor that handles logging-related annotations.
Java
5
star
82

woodstock

Java
4
star
83

javax.resource

Repository for javax.resource api
Java
4
star
84

concurrency-ee-spec

concurrency-ee-spec~source-code-repository
Java
4
star
85

javax.xml.rpc

Repository for javax.xml.rpc api
Java
4
star
86

findbugs-tools

The common FindBugs exclude list used by GlassFish projects, as well as related tools used in scripts in Hudson jobs.
Shell
4
star
87

copyright-maven-plugin

The maven plugin that checks for the correct copyright/license notice in files related to the GlassFish project.
Java
4
star
88

connector-spec

4
star
89

metro-fi

Fast Infoset Project, an Open Source implementation of the Fast Infoset Standard for Binary XML.
Java
4
star
90

javaserverfaces

PLEASE NOTE: This project has moved to Eclipse Foundation and will be archived under the JavaEE GitHub Organization. After Feb. 1, 2021, the new location will be github.com/javaee/javaserverfaces-web
HTML
4
star
91

grizzly-npn

grizzly-npn
Java
3
star
92

fighterfish

Modules supporting use of OSGi by Java EE applications.
Java
3
star
93

jaxb-istack-commons

jaxb-istack-commons
Java
3
star
94

glassfish-license-tool

glassfish-license-tool
Java
3
star
95

gmbal-pfl

Primitive Function Library
Java
3
star
96

javax.xml.registry

Repository for javax.xml.registry api
Java
3
star
97

glassfish-docs

Documentation resources (online help, etc.) for the GlassFish project.
HTML
3
star
98

metro-maven-jaxb2-plugin

Metro has been contributed to Eclipse Foundation. This repository is for legacy review only. Please refer to the Eclipse EE4J Metro project for the very latest
Java
3
star
99

repackaged

Copies of third party open source projects that are used in the build of GlassFish, along with tools to build those projects. GlassFish depends on the versions of these projects that we build, not directly on binaries produced by the originating project.
Shell
3
star
100

metro-package-rename-task

metro-package-rename-task
Java
2
star