All Classes

Class Description
AbstractConsoleServer
This abstract class can be sub-classed to easily create simple servers running on the console.
Several TEMPLATE METHODs allow to define the concrete logic and to control the behavior in subclasses.
AbstractConsoleServer.ServerState
States for a server's state machine
Why so many states?
AbstractDataManager
Abstract data manager is the abstract base class (aka ABSTRACT FACTORY)
AbstractDataReader
Abstract data reader is one base class of the ABSTRACT PRODUCTs each concrete ABSTRACT FACTORY can create.
AbstractDataWriter
Abstract data writer is one base class of the ABSTRACT PRODUCTs each concrete ABSTRACT FACTORY can create.
AbstractEnterpriseUnit
Abstract Enterprise Unit is the abstract base class of the COMPOSITE implementing the interface of the component (EnterpriseNode).
AbstractFactoryTest
Test case for ABSTRACT FACTORY
AbstractHistoryQueryEngine
Abstract History Query Engine - some engine that performs synchronous queries which take some time.
AbstractMapper
Abstract Mapper - mappers in this example extend this base class
AbstractTemplateMethodStringCodec
Abstract Template Method String Codec
This demonstrates TEMPLATE METHOD pattern
AbstractThreadedSocketServer
Abstract Threaded Socket server
This is a threaded socket server, it can accept and process an arbitrary number of connections concurrently.
A subclass only has to implement the concrete communication operations, the other stuff is handled by logic in the super classes (TEMPLATE METHOD pattern).
AbstractVoucher
Abstract Voucher is the abstract product in this FACTORY METHOD example scenario.
AbstractVoucherCreator
Abstract Voucher Creator is the abstract creator in this FACTORY METHOD example scenario.
AbstractWorker
Abstract Worker (a COMPOSITE-interface) represents the AGGREGATE (abstract base class), an iterator will be created for.
Account
Account - supplementary class
AccountManager
Account Manager - a component to be tested
An instance can only be tested with a valid AddressValidator reference injected.
AccountValidationException
Account Validation Exception - supplementary class in this example
ActiveObjectTest
Active Object Test - demonstrates ACTIVE OBJECT pattern.
AdapterTest
Adapter test demonstrates the ADAPTER pattern.
Address
Address - an object in this scenario (supplementary).
Address
Address - entity in COARSE GRAINED LOCK example
Address
Address - entity in the first subsystem
AddressDto
Address DTO - one of the data transfer objects in this example.
AddressEntity
Address Entity - one of the business entities in this example.
AddressEntity
Address Entity - one of the business entities in this example.
AddressValidatorService
Address Validator Service - interface of a service our component needs and that will not be available when testing our component.
AddressValidatorServiceMock
Address Validator Service Mock - SERVICE STUB (aka Mock) for AddressValidator Service
This is a very simple mock, always returning a predefined result, more sophisticated mocks create matching results for different input sets.
AllTests
All Tests - Test suite for all pattern tests.
AnonymousCountingKeyCollision
An AnonymousCountingKeyCollision represents a key occurrence at two or more positions without the key counting but not storing multi-occurrences.
AnonymousTrackingKeyCollision
An AnonymousTrackingKeyCollision represents a key occurrence at two or more positions including all positions but discarding the key.
AppendTextCommand
Text Command - a concrete COMMAND.
Article
Article - a supplementary class in FACADE example.
ArticleHistory
Article History - another class of the component we create a FACADE for.
The history delivers details related to an article but not part of the core information.
ArticleManager
Article Manager - class of the component we create a FACADE for.
ArticleViewFacade
Article View Facade- a FACADE for article management, with restricted access (read-only) and extended by an option to get the mark down price.
AtomicFixedLengthBitVector
AtomicFixedLengthBitVector is a fixed-size bit-vector implementation for concurrent access.
AtomicFixedLengthBitVectorTest
Test coverage for the bit vector
BloomFilterConfig
A BloomFilterConfig consists of the best estimates for the parameters m, n, k and epsilon given two of them.
The remaining settings will be computed (derived).
BloomFilterConfigTest
Test coverage for the bloom filter configuration and estimation
BoxingUtils
Convenient auto-boxing support, i.e. for arrays.
BoxingUtilsTest  
BridgeTest
Bridge Test - demonstrates BRIDGE pattern.
BufferType
The ParallelFileInputStream supports three types of buffers.
BuilderTest
Builder Test - demonstrates BUILDER pattern.
CharsetUtils
This utility class provides support to work with characters of different character sets especially related to the encoded byte-length of their characters.
Checksum
Checksum - the PRODUCT to be built in this BUILDER pattern demonstration.
ChecksumBuilder
Checksum Builder - interface for checksum BUILDERs.
The PRODUCTs of these checksum builders are Checksum instances.
If not otherwise stated, concrete instances are NOT safe to be used concurrently by multiple threads.
ChecksumHelper
Checksum Helper - the DIRECTOR in this BUILDER example.
Instances of this class create a checksum out of a given object array using a BUILDER.
These helper instances are not safe to be used concurrently by multiple threads.
CloneUtils
Methods for cloning objects to ensure independent copies.
CloseUtils
Methods to simplify closing (chains of) resources and to make code less verbose.
CoarseGrainedLockTest
Coarse Grained Lock Test - demonstrates COARSE GRAINED LOCK pattern.
CombinedMethodTest
Combined Method test - demonstrates COMBINED METHOD pattern.
This test ("the client") calls remote methods, first sequentially than using a combined method to avoid inconsistencies.
CombinedOrderedItemIterator<E extends java.lang.Comparable<E>>
The CombinedOrderedItemIterator iterates over all the given input iterators and creates an ordered squence.
CommandProcessorTest
Command Processor Test - demonstrates COMMAND PROCESSOR pattern.
CommandTest
Command Test - demonstrates COMMAND pattern.
Company
Company is a concrete item type inheriting from AbstractEnterpriseUnit and thus implementing the interface of the COMPOSITE (EnterpriseNode).
Component
Component - supplementary interface in the DEPENDECY INJECTION example, interface to be implemented by Components of our framework.
ComponentCreationException
Exception to be thrown by the framework to indicate that the creation of the component failed.
ComponentFramework
Component Framework - supplementary class in DEPENDENCY INJECTION example
Allows the client to create a component, injects the necessary references before handing over the component to the client.
ComponentWithAnnotationBasedInjection
Component With annotation based Injection
ComponentWithConstructorInjection
Component With Constructor Injection - demonstrates CONSTRUCTOR INJECTION
ComponentWithInterfaceInjection
Component With Interface Injection - demonstrates INTERFACE INJECTION
ComponentWithSetterInjection
Component With Setter Injection - demonstrates SETTER INJECTION
CompositeTest
Composite Test - demonstrates COMPOSITE pattern.
CompoundKey
Compound Key - used in IDENTITY FIELD example
Simple compound key (composite key) implementation following Martin Fowler's approach.
ConcreteCounterFlyweight
Concrete Counter Flyweight - a concrete FLYWEIGHT implementation.
ConcreteHostNameData
Concrete Host Name Data - a real host name data implementation
ConnectorException
Exception to be thrown in case a specific connector reports an (wrapped) error
Context
Context - some kind of system registry in this STRATEGY demonstration.
CounterFlyweight
Counter Flyweight - interface all concrete FLYWEIGHTs in this example must implement.
CounterFlyweightCarryingItem
Counter Flyweight Carrying Item - demonstrates a FLYWEIGHT carrying item.
In a real-world scenario this could be a cell in a sheet carrying a cell renderer, which is the flyweight.
CounterFlyweightFactory
Counter Flyweight Factory - demonstrates a FLYWEIGHT factory.
CountingKeyCollision
A CountingKeyCollision is a key that occurred at two or more positions counting but not storing multi-occurrences.
Crc32ChecksumBuilder
CRC32 Checksum Builder - concrete checksum BUILDER implementation using CRC32.
Crc32HashStrategy
Crc32 Hash Strategy - concrete hash STRATEGY using CRC32.
Customer
Customer - entity in COARSE GRAINED LOCK example
Customer
Customer - interface for customer representations, introduced in this example to allow transparently handling different representations (DATA TRANSFER OBJECT vs. entity remote interface) by the client - for demonstration purposes only.
Customer
Customer - entity in the second subsystem
Customer
Customer - entity providing OPTIMISTIC OFFLINE LOCK capabilities
Customer
Customer - entity in PESSIMISTIC OFFLINE LOCK example
CustomerCompany
Customer Company - part of customer structure, may carry a discount negotiated between us (seller) and the company.
CustomerDivision
Customer Division - part of customer structure, a customer's business division may carry a special discount negotiated between us (seller) and the division manager.
CustomerDto
Customer DTO - the DATA TRANSFER OBJECT
CustomerDto
Customer DTO - one of the data transfer objects in this example.
CustomerDwhInfoDto
Customer Dwh Info DTO - one of the data transfer objects in this example.
CustomerDwhInfoDto.Builder
Fluent builder to prevent too many constructor arguments
CustomerDwhInfoEntity
Customer Dwh Info Entity - one of the business entities in this example.
This entity gives us a lot of information collected or derived in our company's data warehouse
CustomerDwhInfoEntity.Builder
Fluent builder to prevent too many constructor arguments
CustomerEntity
Customer Entity - the server entity (from persistence) Note: To better visualize the runtime differences between direct remoting and using DATA TRANSFER OBJECT, CustomerEntity itself has been implemented as remote object, this is only for testing here and rather atypical!
CustomerEntity
Customer Entity - one of the business entities in this example.
CustomerEntity
Customer Entity - one of the business entities in this example.
CustomerHolding
Customer Holding - part of customer structure, there can be a holding discount which applies to all orders from any company related to this holding.
CustomerInfo
Customer Info - interface of the target component, which the WRAPPER provides.
CustomerManager
Customer Manager - interface for customer persistence service, implemented by the customer manager server for finding customers
CustomerManagerServer
Customer Manager Server - a remote service handling persistence
CustomerManagerServerException
Unchecked Exception to be thrown by the customer manager in case of internal errors.
CustomerMapper
Customer Mapper - demonstrates MAPPER pattern
In the first subsystem there exists a Person entity and an address entity.
For some reason in a second subsystem a Customer entity exists including address information.
This mapper is responsible for transparently mapping data between the two without giving one subsystem any knowledge of the other one.
Neither of the subsystems is aware of the mapper.
CustomerOrder
Customer Order - each order can carry a special discount.
CustomerRemote
Customer Remote - demonstrates DATA TRANSFER OBJECT pattern, a tagging interface for technical reasons
CustomerService
Customer Service - customer data access component
In this example I was just too lazy :-) to implement real remoting here.
Database
Database - static placeholder for any kind of persistence in this example
Database
Database - static placeholder for any kind of persistence in this example
Database.Builder
BUILDER for easier setup of a our fake Database
Database.Builder
Builder to avoid huge constructor for setting up our "database"
DatabaseException
Exception to be thrown by the fake database to indicate internal problems.
DataManager
Data Manager - supplementary class in IDENTITY FIELD pattern
DataManager
Data Manager - provides finder methods in this example, placeholder for whatever persistence framework/strategies may be in use.
DataManager
Data Manager - supplementary class for MAPPER demonstration, this is rather a placeholder for some way to deal with the database.
DataManager
Data Manager - handles persistence in this OPTIMISTIC OFFLINE LOCK example
Placeholder for any kind of database access management (i.e.
DataManagerException
Exception to be thrown by the data manager in case of internal problems.
DataTransferObjectTest
Data Transfer Object test - demonstrates DATA TRANSFER OBJECT pattern
DecoratorTest
Decorator test - demonstrates DECORATOR pattern
DefaultSecuMangaGatewayClient
SecuManga Gateway Client - The client part of the GATEWAY.
This class encapsulate webservice handling, the client just uses normal methods.
DeleteTextCommand
Delete Text Command - a concrete COMMAND.
DependencyInjectionTest
Dependency injection test - demonstrates DEPENDENCY INJECTION
DerbyDriverSetupException
Unchecked exception to be thrown if the embedded driver could not be loaded or instantiated.
DerbyJarNotFoundException
Exception to be thrown when the embedded Java-DB (Derby) could not be initialized because the related jar was not available.
Division
Division is a concrete item type inheriting from AbstractEnterpriseUnit and thus implementing the interface of the COMPOSITE (EnterpriseNode).
DocumentAccessException
Exception in this fake access management scenario to indicate an access violation.
DocumentManager
Document Manager is the interface the concrete manager as well as its PROXY will implement.
DocumentManagerSecurityProxy
Document Manager Security Proxy protects a Document Manager in this PROXY example.
EchoServer
Echo server - concrete class implementing the operations used by TEMPLATE METHODs of AbstractThreadedSocketServer.
This socket server returns each received line immediately.
EffectiveDiscountVisitor
Effective Discount Visitor - a VISITOR collecting information to determine the effective discount.
EmbeddedJavaDbDataSource
Pseudo-DataSource (SINGLETON) to access embedded Java DB.
EnterpriseNode
Enterprise Node is the COMPONENT interface in this COMPOSITE-example.
EnterpriseVisitor
Enterprise Visitor - interface to be implemented by all concrete VISITORs
Entity
Entity - compound key carrying entity in IDENTITY FIELD pattern
Entity<K>
Entity - this interface must be implemented by all entities in the system
ExampleObjectPool
Example Object Pool - demonstrates an OBJECT POOL.
ExampleReusableObject
Example reusable object for being pooled
ExampleScriptingFramework
This minimum framework demonstrates the usage of the PLUGIN pattern.
ExampleScriptingFrameworkException
Unchecked Exception used by the scripting framework
ExampleTemplateMethodStringCodec
Example Template Method String Codec - concrete Codec, demonstrates TEMPLATE METHOD pattern
ExternalConsoleHandlerThread
This thread observes an input stream from an external console and passes the data line by line to a given logger.
ExternalProcessManagementException
Exception to be thrown if the ExternalProcessManager detected problems handling the child process.
ExternalProcessManager
This class (singleton) helps to start and stop external java program instances.
FacadeTest
Facade Test demonstrates FACADE pattern.
FactoryMethodTest
Test case for FACTOY METHOD
FileAccessException
Unchecked exception for wrapping Exceptions or indicating unexpected runtime issues when dealing with files.
FileLine
Representation of a single text line from a file.
FileMacroPlugin
File Macro Plugin provides macros for file access.
FileUtils
Utilities methods for dealing with files
FlyweightTest
Flyweight Test - demonstrates FLYWEIGHT pattern.
Fraction
Fraction demonstrates a VALUE OBJECT, fractions are immutable.
FreakliesShopVoucher
FreakliesShop Voucher (Voucher from the little shop owned by Mrs.
FreakliesShopVoucherCreator
FreakliesShop Voucher Creator is a concrete creator in this FACTORY METHOD example scenario.
GatewayTest
Gateway test, demonstrates GATEWAY pattern
GenericOHBF
The GenericOHBF is a general-purpose thread-safe serializable fixed-size One-Hashing Bloom Filter.
GenericOHBFTest
Test coverage for the Generic one-hashing bloom filter
GeoBadPayerInfoDto
Geo Bad Payer Info Dto - data transfer object to be assembled, contains information to be collected from different business entities.
In our fictional scenario a list of bad payers related to their location has to be displayed.
GeoBadPayerInfoDto.Builder
Builder to avoid over-parameterized constructor
GeoBadPayerInfoDtoAssembler
Geo Bad Payer Info DTO Assembler - the TRANSFER OBJECT ASSEMBLER
The knowlegde which entities' data to query and which particular attributes to include has been centralized here.
HalCorpPersonDataConnectorImp
HalCorp Person Data Connector Imp - a concrete member of the "bridged-out" hierarchy.
HalCorpSecurePersonDataConnectorImp
HalCorp Person Data Connector Imp - a concrete member of the "bridged-out" hierarchy.
HashGenerator
Interface for generators to compute a hash value of fixed length (see HashGenerator.getHashLength()) over a number of attributes
HashGenerators
Provides generators for any required bit length
HashGeneratorTest
Test coverage for hash generator creation
HashStrategy
Hash Strategy - abstract base class for concrete hash-STRATEGY classes.
Implementing classes compute hashes for strings.
HashStrategyException
Unchecked exception to be thrown by a concrete hash strategy in case of internal errors.
HistoryQueryComponent
History Query Component - the api from the client's point of view, it provides asynchronous access to the underlying engine to perform queries possibly taking some time.
HistoryQueryEngineMock
History Query Engine Mock - in this example this is a component implementation for executing queries that may take some time.
HistoryQueryScheduler
History Query Scheduler - isolates the history query component from thread management and control of maximum number of parallel calls.
Holding
Holding is a concrete item type inheriting from AbstractEnterpriseUnit and thus implementing the interface of the COMPOSITE (EnterpriseNode).
HostNameData
Host Name Data - the interface defines the methods, both concrete object and null object must provide
HostNameDataNullObject
Host Name Data Null Object - NULL OBJECT implementation for HostNameList
HostNameDataProvider
Host Name Data Provider - supplementary class in this example, uses NULL OBJECT to tell a caller about missing HostNameData instances
IdentityFieldTest
Identity Field Test - demonstrates compound key in IDENTITY FIELD pattern
IdentityMap<K,​E extends Entity<K>>
Identity Map - demonstrates IDENTITY MAP
IdentityMapTest
Identity Map Test - demonstrates IDENTITY MAP pattern.
IndexedTextFileAccessor
Indexed Text File Accessor creates an index for a given file and allows to jump to specific characters or lines.
This is intended for reading large text files which won't be modified after index creation.
An instance is safe to be used concurrently by multiple threads.
IndexedTextFileAccessorTest
IndexedTextFileAccessorTest - some tests for IndexedTextFileAccessor class
InMemoryLockManager
In-Memory Lock Manager - manages locks in the COARSE GRAINED LOCK example
In non-distributed scenarios it often makes more sense to leverage an in-memory lock management rather than storing lock information in database tables.
A big advantage (besides performance) of in-memory management is the fact that the system is always in a clean state after startup (no lock zombies surviving in lock tables).
InMemoryLockManager.ElementLock
Implementation of an immutable element lock with metadata and option to wait for release
InMemoryLockManager.LockType
Enumeration of supported lock types
InputCommand
Input Command - to be extended by concrete COMMANDs.
InputCommandProcessor
Input Command Processor - a COMMAND PROCESSOR for InputCommands.
InvalidPrefixException
Exception to be thrown if the provided prefix is invalid, e.g. because it is too long or contains bad characters.
Invoice
Invoice - supplementary class to demonstrate LAZY LOAD pattern.
Each invoice has a number of fields, but only the invoiceId and the amountClaimed will be loaded by default.
ItemConversionException
Exception to be thrown if an item could not be converted
ItemConversionIterator<E,​C extends ItemStringCodec<E>>
For working with files this ITERATOR returns the elements converted from the data a buffered reader returns.
ItemStringCodec<E>
The ItemStringCodec is an interface for a POLICY to transform an element to a String and vice-versa for writing/reading files.
IteratorTest
Iterator Test - demonstrates ITERATOR pattern.
ItfaConfiguration
ItfaConfiguration covers several settings for the indexer.
JavaDocSourceHolder
The holder keeps the state during reformatting a singl code-html-file generated by javadoc.
JavaDocSourceTransformer
This class reformats the output (src-html) of the javadoc tool.
JavaWrapperType
This enum contains the known java primitives and their wrapper types as an easy lookup.
JavaWrapperTypeTest  
KeyAtPos
KeyAtPos is a VALUE OBJECT that represents a key at a certain position.
When comparing keys to bring them in an order, the KeyAtPos.getKey() takes precendence over KeyAtPos.getPos().
KeyCollision<T extends KeyCollision<T>>
Interface for collision items, used for collecting, intermediate storage and aggregation
KeyCollisionCollectionPolicies
This class provides convenient access to the standard policies for key collision collection.
KeyCollisionCollectionPolicy<T extends KeyCollision<T>>
A KeyCollisionCollectionPolicy is a POLICY that defines how to collect collisions
KeyCollisionDataPoint
KeyCollisionDataPoint is a VALUE OBJECT that represents a statistic data point, natural order is defined on KeyCollisionDataPoint.getPosition().
KeyCollisionIterator<K extends KeyCollision<K>>
The KeyCollisionIterator is a DECORATOR for a KeyAtPos-ITERATOR.
KeyCollisionProcessException
Unchecked exception used during key processing to indicate problems
KeyCollisionProcessor<K extends KeyCollision<K>>
A KeyCollisionProcessor generates a specified number of keys provided by a supplier in a keyspace and analyzes key collisions.
KeyCollisionSummary
A KeyCollisionSummary contains the collision statistics collected while processing a number of keys in a keyspace.
KeyCollisionTest
MUHAI Key Collision Test - here we demonstrate the collision behavior by creating large amount of keys and detecting collisions.
LambdaSupportLoggerProxy
LambdaSupportLoggerProxy is a PROXY to easier support lambda expressions as arguments to the SLF4J-Logger's logging methods.
LambdaSupportLoggerProxyTest  
LazyLoadTest
Lazy Load Test - demonstrates LAZY LOAD pattern.
LciWrapperException
Exception thrown by the wrapper in case of internal problems
LegacyCustomerInfo
Legacy Customer Info - a WRAPPER for the OldSys legacy system
LegacyCustomerInfoProvider
Legacy Customer Info Provider - creates customer infos, uses WRAPPERs for customer infos loaded from the legacy OldSys
LockManagementException
Unchecked exception to be thrown by the lock manager in case of severe internal errors.
LockManager
Lock Manager - manages locks in this PESSIMISTIC OFFLINE LOCK example
This one uses a global lock table in the database
LockManager.LockInfo
In-memory representation of lock data
LockManager.LockType
Enumeration of supported lock types
LogUtils
Some utility methods related to java logging.
LongPrefix
The LongPrefix is a VALUE-object that represents a valid prefix sequence for a long value to define a keyspace.
LongPrefixTest
Test coverage for the LongPrefix
MacroPlugin
The plugin interface each PLUGIN must implement.
MacroPluginFactory
Macro plugin factory finds, initializes and manages plugins.
MacroPluginFramework
Macro plugin framework interface defines the methods a plugin may use to access properties and methods of the surrounding framework.
MacroPluginRuntime
Macro Plugin Runtime Interface must be implemented by each plugin, it defines the methods for calling macros.
MacroPluginTechInfo
Technical interface each Macro-plugin must implement to be recognized by framework.
MapperTest
Mapper Test - demonstrates MAPPER pattern.
MasterSlaveTest
Master Slave Test - demonstrates MASTER SLAVE pattern.
MessageMock
Message mock supports testing the hash STRATEGY.
ModelViewControllerTest
Model View Controller Test - demonstrates MODEL VIEW CONTROLLER pattern.
Money
Money - a MONEY demo implementation
Please be aware that this implementation has absolutely nothing to do with high performance or optimized memory consumption. :-)
You'll find full fledged and well tested Money libraries in the web.
MoneyTest
Money Test - demonstrates MONEY pattern and consequences when ignoring the basic problem.
MoronStoreVoucher
MoronStore Voucher (Voucher from the MoronStore Worldwide Company) is a concrete product in this FACTORY METHOD example scenario.
MoronStoreVoucherCreator
MoronStore Voucher Creator is a concrete creator in this FACTORY METHOD example scenario.
MuhaiException
Unchecked exception, thrown by Muhai in case of unexpected errors.
MuhaiGenerator
MuhaiGenerator is an implementation of Mostly Unique Hashed Attributes Identifier.
MuhaiGeneratorTest
Test coverage for the MUHAI Generator
MuhaiParseException
Exception to be thrown if a given String representation cannot be converted into a MUHAI (long).
MuhaiTest
MUHAI Test: demonstrates the creation of Mostly Unique Hashed Attributes Identifiers (MUHAI)
MuhaiUtils
A couple of utilities and shorthands for dealing with MUHAIs (the type long in Java is signed).
MuhaiUtilsTest
Test coverage for the MuhaiUtils
MultiGlomPersonDataConnectorImp
MultiGlom Person Data Connector Imp - a concrete member of the "bridged-out" hierarchy.
MultiGlomUdpPersonDataConnectorImp
MultiGlom UDP Person Data Connector Imp - a concrete member of the "bridged-out" hierarchy.
NullObjectTest
Null Object Test - demonstrates NULL OBJECT pattern.
NumberSequence
Number sequence is the common interface components to be decorated as well as the decorator implement when applying the DECORATOR pattern
ObjectPoolTest
Testcase for ExampleObjectPool and related stuff
ObserverTest
Observer Test - demonstrates OBSERVER pattern.
OldSysCustomerMgr
OldSys Customer Manager - part of the fictional legacy system, we want to create a WRAPPER for.
OldSysCustomerMgrMock
OldSys Customer Manager Mock - mocks the old system's customer manager.
OldSysHistoryMgr
OldSys History Manager - part of the fictional legacy system, we want to create a WRAPPER for.
OldSysHistoryMgrMock
OldSys History Manager Mock - mocks the old system's history manager.
OptimisticOfflineLockTest
Optimistic Offline Lock Test - demonstrates OPTIMISTIC OFFLINE LOCK pattern.
OrbOfConfusion
This class implements the "Orb Of Confusion" algorithm which performs a shuffled partition index transformation on an arbitrary range of positive numbers.
Objective: Map bijectively any number of a given range to another number of the same range where the mappings are not easy to be guessed.
Order
Order - entity in COARSE GRAINED LOCK example
OrderedChunkFilewriter<E extends java.lang.Comparable<E>>
The OrderedChunkFilewriter writes items to files, so that a single file will not contain more that a specified number of items.
The items will be written according to their natural order, so that a single chunk file will appear sorted.
OrderItem
Order Item - one or more order items are assigned to one order, each item specifies a product and the amount.
OutputObservable
Output Observable is the interface concrete observables have to implement to allow concrete OBSERVERS to register.
OutputObserver
Output Observer is the interface a concrete OBSERVER implements.
OutputWorker
Output Worker is a concrete observable in this OBSERVER example.
OverloadState
A OverloadState instance represents the overload state of the ThroughputLimiter including an overload start time and a latch (where requesters can wait for).
PalindromeCheckFuture
Palindrome Check Future - allows the MASTER to poll for the result and the SLAVES to report their results.
PalindromeCheckMaster
Palindrome Check Master - the MASTER in this MASTER SLAVE example, divides the task into subtasks waits for the slaves to complete the sub-tasks and returns the result.
PalindromeCheckResult
Palindrome Check Result - represents result of palindrome check
PalindromeCheckSlaveTask
Palindrome Check Slave Task - executes a SLAVE's work in this MASTER-SLAVE example.
An instance runs in a separate thread and sends its result to his MASTER.
ParallelFileInputStream
Parallel File Input Stream - input stream using a concurrent reader thread.
This class is useful for reading large files especially if processing takes longer than reading.
ParallelFileInputStreamTest
Parallel File Input Stream Test - tests for ParallelFileInputStream
PersistenceSession
Persistence Session - supplementary class for LAZY LOAD demonstration
Placeholder for some kind of persistence management.
Person
A person object in this scenario (supplementary).
Person
Person - entity in the first subsystem
PersonDataConnector
Person Data Connector - this is the service abstraction (root of a hierarchy) where we have "bridged-out" a parallel hierarchy implementing core functionality.
This shows the BRIDGE-pattern.
PersonDataConnectorImp
Person Data Connector Imp - interface to be provided by concrete PersonDataConnectorImps.
PersonViewAdapter
Person view adapter implements the target system person view interface and acts as an ADAPTER for SourceSystemPersonView items.
PessimisticOfflineLockTest
Pessimistic Offline Lock Test - demonstrates PESSIMISTIC OFFLINE LOCK pattern.
PlainFileDataManager
Plain file data manager uses a text file for persistence, it demonstrates a CONCRETE FACTORY.
PlainFileDataReader
Plain file data reader, a CONCRETE PRODUCT of CONCRETE FACTORY
PlainFileDataWriter
Plain file data writer, a CONCRETE PRODUCT of CONCRETE FACTORY
PluginTest
Plugin test demonstrates the PLUGIN pattern
PoolThread
Managed thread for pooling.
PrintService
Print service - supplementary service interface, just some service to print
PrintServiceImpl
Print service - supplementary concrete service implementation, creates log message
PrintServiceInjectable
Print Service Injectable - demonstrates INTERFACE INJECTION
Components implementing this interface signal to the framework that they want to have injected a reference to print service.
Product
Product - supplementary product class
ProductManager
Product Manager - interface provided by the remote product manager server, originally with two methods to first acquire a new id and than register the product.
ProductManagerServer
Product Manager Server - the server side
ProductManagerServerException
Unchecked exception to be thrown by the product manager server to indicate technical issues.
ProgressObserver
Progress Observer is a concrete OBSERVER implementation, writing a progress message to log channel.
PropertyRegistry
Property Registry - a simple registry: safe to be accessed concurrently with minimum synchronization, providing the ability to be refreshed at any time.
ProxyTest
Proxy Test demonstrates PROXY pattern.
QueryRequest
Query Request - objectified request
QueryRequestFuture
Query Request Future - allows the client to check the status and finally to retrieve the result of the scheduled operation.
RegistryTest
Registry test - demonstrates the REGISTRY pattern.
Request
Request - Supplementary class representing objects using a Universally Unique ID (UUID/GUID)
RwPersonDataConnector
Rw Person Data Connector - this is a subclass in the main hierarchy, which evolves independently from the "bridged-out" hierarchy.
In this example the subclass adds additional behavior based on the super class and the "bridged-out" core functionality.
SecuMangaGatewayClient
SecuManga Gateway Client interface, this additional interface helps to create mocks for testing "client-only".
SecuMangaGatewayException
Exception to be thrown by the gateway to report (wrapped) exceptions.
SecuMangaGatewayServer
The SecuManga Gateway provides access to the fictional native legacy SecuManga security library.
SecuMangaGatewayWebService
Secu Manga Gateway Web Service is the server-side implementation of the web service, the server-part of GATEWAY.
Here we delegate calls to the "native" SecuManga-API.
SecuMangaServerMock
SecuManga is a fictional native encryption library a GATEWAY will be provided for in this demonstration.
SecuMangaService
This class was generated.
SecuMangaWebService
This class was generated by the JAX-WS RI.
SecureFileDataManager
Secure file data manager uses a text file for persistence, it demonstrates a CONCRETE FACTORY.
SecureFileDataReader
Secure file data reader, a CONCRETE PRODUCT of CONCRETE FACTORY
SecureFileDataWriter
Secure file data writer, a CONCRETE PRODUCT of CONCRETE FACTORY
SequenceBlock
The sequence block holds a chunk of sequence numbers (a unique range)
SequenceBlockCache
The sequence block cache manages an arbitrary number of sequences using the SEQUENCE BLOCK pattern.
SequenceBlockManagementException
Unchecked exception to be thrown by the sequence block cache in case of internal errors.
SequenceBlockTest
Sequence block test case to demonstrate SEQUENCE BLOCK pattern
ServiceStubTest
Service Stub test - demonstrates SERVICE STUB (aka MOCK) pattern.
Session
Session - supplementary class, the place where the IDENTITY MAPs reside in this example.
Session
Session - supplementary class for MAPPER demonstration
According to Martin Fowler the mapper can't be invoked directly by either of the two components it is connected to, because they both don't even know of the mapper.
One solution is a third party driving the mapper.
Sha1HashStrategy
Sha1HashStrategy - concrete hash STRATEGY using SHA-1.
ShufflingSequenceDecorator
Shuffling sequence decorator decorates a number sequence, scrambles the ids (bijectively) and adds further operations.
SimpleAccessException
Indicates an access denial by the SimpleAccessManager
SimpleAccessManager
Simple Access Manager is a trivial supplementary class simulating a kind of security system.
Important:
You should NEVER EVER implement your own security system, there are APIs for that which have been audited well.
However in the current example there is a central flaw.
Anyone getting a reference to the permissionsMap (via reflection) using setAccessible(true) can do just everything.
SimpleDocumentManager
Simple Document Manager is a concrete document manager.
SimpleNumberSequence
Simple Number sequence is a concrete component to be decorated applying the DECORATOR pattern
This implementation is thread-safe.
SimpleScrambleCodec
SimpleScrambleCodec scrambles/unscrambles text in a trivial way for demo purposes in several scenarios.
SimpleThreadPool
Simple Thread-Pool implementation using worker pool threads.
I originally wrote this class in 2004 and although nowadays using the Executors framework (java.util.concurrent) should be preferred(!)
SimpleThreadPoolTest
Test case to demonstrate thread pool.
SingletonTest
Singleton Test - demonstrates SINGLETON pattern.
SocketCommunicationException
An IO-Exception to be thrown in case of socket communication issues that could not be handled otherwise.
SocketPreparationException
A Runtime Exception to be thrown if the socket preparation went wrong
SourceLine
Represents a single line of source code found in the output of javadoc.
SourceLineInterpreter
For reformatting the source code output of javadoc we need a minimal understanding of
the raw input (distinguish source lines from supplementary text).
This interpreter deals with the source lines to split them into phrases that can be formatted individually.
SourceLineInterpreter.CommentType  
SourceLineInterpreter.Phrase  
SourceSystemPersonView
Source system person view plays the role of an existing class.
StaffMember
Staff member is the LEAF implementing the component interface
StrategyTest
Strategy Test - demonstrates STRATEGY pattern.
StringMacroPlugin
String macro plugin allows string manipulation
TargetSystemPersonView
Target system person view is an interface in the target system, which has to be provided for integration.
TeamController
Team Controller - the CONTROLLER in this MVC-example.
TeamModel
Team Model - the MODEL in this MVC-example holding the member data of a team.
TeamModel.TeamModelObserver
Team Model Observer - allows to observe model changes.
TeamView
Team View - the VIEW in this MVC-example.
TemplateMethodTest
Template Method Test - demonstrates the TEMPLATE METHOD pattern.
TextComponent
Text Component - the RECEIVER in this COMMAND example.
ThroughputCheckerThread
A ThroughputCheckerThread manages a ThroughputListener at runtime.
It is obviously impossible to notify the observer synchronously since there are possibly millions of concurrent calls to a ThroughputLimiter.
ThroughputEvent
A ThroughputEvent contains some KPIs about a ThroughputLimiter's current state.
ThroughputEvent.Timing
Contains the time-related information of the event
ThroughputLimiter
A ThroughputLimiter allows to limit and observe the number of events (i.e. executions or requests) in a configurable time interval (floating), see also ThroughputLimiter.MAX_STORABLE_NANOS.
ThroughputListener
Clients may register a ThroughputListener to observe a ThroughputLimiter.
The listener will be called periodically in a separate thread.
TimeUtils
Utility class to support some time computation.
Tracer
Tracer - a straight forward thread-safe SINGLETON implementation
Tracer2
Tracer2 - a more sophisticated thread-safe SINGLETON implementation
Discussion:
It is highly questionable whether the fewer synchronization effect justifies the much more complex (harder to read) implementation.
For example error handling gets really weird, since the point where errors can occur (here: file access problem during class initialization) is surprising.
TracerException
Unchecked exception for the singleton tracer scenario.
TrackingKeyCollision
A TrackingKeyCollision is a key that occurred at two or more positions including all positions.
TransferObjectAssemblerTest
Transfer Object Assembler Test - demonstrates TRANSFER OBJECT ASSEMBLER pattern.
UnexpectedInterruptedException
Unchecked exception to indicate to the caller that an operation was interrupted unexpectedly.
UnsharedConcreteCounterFlyweight
Unshared Concrete Counter Flyweight - unshared flyweights can be returned by a factory - transparently from the client's point of view.
UUIDTest
UUID Test - demonstrates the Universally Unique Identifier (UUID/GUID) pattern.
Note: We do not provide an example implementation of a UUID-generator because Java (same for .NET) already provides a professional UUID-class, that should be used rather than some do-it-yourself-version.
ValueObjectTest
Value Object Test - demonstrates VALUE OBJECT pattern.
VisitorTest
Visitor Test - demonstrates VISITOR pattern.
WebMake
Generator for the web content of patterns-kompakt.de
This is pure legacy (avoid breaking representation change and existing links from other websites).
The code is hard to maintain as it does a lot things manually (with a weird pseudo-DSL) much better supported by real documentation frameworks.
Worker
Worker represents the concrete AGGREGATE which can return an ITERATOR.
WorkerIterator
Worker Iterator - the ITERATOR implementation in this example.
WrapperTest
Wrapper Test - demonstrates WRAPPER pattern
XyPerson
XyPerson - an object in this scenario (supplementary).