AIMA3e Architecture and Design (original) (raw)

Comments on architecture and design

General goals

Architecture and design decisions within AIMA3e are driven by the following design goals:

  1. Algorithms should semantically be implemented as close as possible to the textbook.
  2. The design should be flexible and extendable. A wide range of experiments with existing algorithms should be supported as well as experiments with own extensions / variants of existing algorithms.
  3. Redundancy should be avoided where possible.
  4. Object-oriented design is assumed to be key for reaching goals 2 and 3.
  5. The implementation of the core algorithms should not depend on example applications, GUI stuff etc.
  6. The implementation of the core algorithms should be efficient enough to be applicable in serious application scenarios, not just for demonstration purposes.

Goals 2 and 3 force to add architecture to the set of algorithms presented in the textbook. Common aspects of algorithms must be factored out. In an object-oriented design (Goal 4) this leads to a distribution of responsibilities to different objects. This is why a one-to-one mapping from pseudocode to Java code cannot always be expected.

Physical view

AIMA3e consists of three main sub-projects and an additional helper sub-project which form the top-level directories of the project:

The sub-projects use Maven directory layout. When defining source paths manually, remember that in most cases two directories are needed: src/main/java and src/main/resources. Sub-project aima-core additionally contains unit test sources in directories src/test/java and src/test/resources.

Logical view

Sub-projects

The three main sub-projects are organized as layered architecture. There are no dependencies from bottom to top:

AIMA3e sub-projects

Naming conventions

The usual Java naming conventions are applied, especially:

For detailed rules on styling, see Google Java Style Guide.

Additionally, special endings are used for names of runnable classes with a static main method:

Design patterns

To increase extendibility and readability at the same time, Gang-of-Four design patterns (see Design Patterns. Elements of Reusable Object-Oriented Software. Gamma et al.) are extensively used. Some examples are listed here:

Understanding the design

General comment

As an extensive study of taxonomies of animals will not necessarily lead to a good understanding of a living ecosystem, understanding complex object-oriented software by just code reading is difficult, too. A hybrid approach of studying code and code documentation together with watching execution step by step by means of a debugger might have more chances of success. Command line demos (see package demo) and unit tests (see package unit) are good starting points. Breakpoints help to reach interesting execution phases quickly.

Comments on design decisions for special parts of the software

More detailed design documentation can be found at the following pages: