# Towards a Reference Architecture for Cargo Ports
## 2 Background  
### Patterns and Reference Architectures  
We present a summary of the concepts of software patterns and reference architectures, which are fundamental to understanding our work. A pattern is a solution to a recurrent problem in a given context; it embodies the knowledge and experience of software experts and can be used for new applications and to guide inexperienced designers. Patterns are described using structured templates that contain sections that define specific information about the problem being solved and its solution, along with recommendations about its use. A frequent way to describe a pattern solution comes in the form of a UML class diagram, complemented with some sequence diagrams that describe dynamic aspects of the use cases and possibly activity or state diagrams. A problem section defines a recurrent problem and the set of forces that constrain its solution. Once the solution is presented, a section on the consequences indicates how well the forces were satisfied by the solution as well as the possible negative aspects of it, such as the extra overhead. An implementation section provides hints on how to use the pattern in an application, indicating what steps are needed and possible realizations. A section on related patterns indicates other patterns that complement the pattern or that provide alternative solutions [18]. This level of detail and precision allows system designers and developers to use them as guidelines to build systems, and for users to understand the effect of the mechanisms they represent. Patterns are also useful for communication between designers and to evaluate and reengineer existing systems [7]. Patterns are applied to designs by instantiating them, which requires tailoring them to the rest of the design, e.g., removing some classes, changing names, or deleting attributes; that is, a pattern behaves like a type in a programming language. The use of patterns for system design is grounded in the principles of design science [19], and several pattern conferences each year introduce new patterns as well as applications of this design style. There are several types of patterns, such as design and architecture patterns, that can be used to build flexible and extensible systems [7; 8]. _Security patterns_ are used to build secure systems by describing ways to control their threats, fix their vulnerabilities, and provide security attributes [20]. _Misuse patterns_ describe how attacks are performed from the point of view of an attacker [21; 22]. They define the environment where the attack is performed, what security mechanisms are needed as countermeasures to stop it, and how to find forensic information to trace the attack once it happens. _Process patterns_ describe the workflows of the activities required to perform some business objective, such as order parts, schedule activities, or similar. A reference architecture (RA) is a standardized, generic software architecture based on a particular domain that does not contain implementation details [5; 6; 23]. It can be seen as a type of pattern for whole architectures that can be instantiated into concrete architectures by adding platform aspects [24]. There is no general agreement about what an RA should contain [23]. [PERSON] [5] presents an example and describes what should be included in one. Some groups define other types of reference architectures, including hardware and other aspects, e.g., the Smart Grid Architecture Model (SGAM) [4; 25] (see the section on related work), but we are not concerned with those types here; we think of this RA as a metamodel for concrete architectures defined as a PIM (Platform Independent Model) in an MDE (Model Driven Engineering) methodology. Security patterns can be added to the RA to handle their identified threats, resulting in a security reference architecture (SRA). An SRA is an abstract architecture describing a conceptual model of security for systems and providing a way to specify security requirements for a range of concrete architectures.