From 0f7b1125bbbae9605fb151115be9585c6f26fc97 Mon Sep 17 00:00:00 2001 From: "Dr Heinz M. Kabutz" Date: Tue, 11 Jun 2019 16:02:04 +0300 Subject: [PATCH 01/10] Bumped up source and target version to Java 6 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 273b572..d6bdf35 100644 --- a/pom.xml +++ b/pom.xml @@ -42,8 +42,8 @@ org.apache.maven.plugins maven-compiler-plugin - 1.5 - 1.5 + 6 + 6 From 2e8d4311aa863b4ff3a1ee772e9565a1dab0be19 Mon Sep 17 00:00:00 2001 From: "Dr Heinz M. Kabutz" Date: Tue, 11 Jun 2019 16:02:19 +0300 Subject: [PATCH 02/10] got rid of

that IntelliJ was inserting into the JavaDocs --- .../java/org/jpatterns/gof/AbstractFactoryPattern.java | 4 ++-- src/main/java/org/jpatterns/gof/AdapterPattern.java | 8 ++++---- src/main/java/org/jpatterns/gof/BridgePattern.java | 2 +- .../org/jpatterns/gof/ChainOfResponsibilityPattern.java | 2 +- src/main/java/org/jpatterns/gof/CommandPattern.java | 2 +- src/main/java/org/jpatterns/gof/CompositePattern.java | 2 +- src/main/java/org/jpatterns/gof/DecoratorPattern.java | 2 +- src/main/java/org/jpatterns/gof/FacadePattern.java | 2 +- src/main/java/org/jpatterns/gof/FactoryMethodPattern.java | 4 ++-- src/main/java/org/jpatterns/gof/FlyweightPattern.java | 2 +- src/main/java/org/jpatterns/gof/IteratorPattern.java | 2 +- src/main/java/org/jpatterns/gof/MediatorPattern.java | 2 +- src/main/java/org/jpatterns/gof/MementoPattern.java | 2 +- src/main/java/org/jpatterns/gof/ObserverPattern.java | 2 +- src/main/java/org/jpatterns/gof/ProxyPattern.java | 2 +- src/main/java/org/jpatterns/gof/SingletonPattern.java | 2 +- src/main/java/org/jpatterns/gof/StatePattern.java | 2 +- src/main/java/org/jpatterns/gof/StrategyPattern.java | 2 +- .../java/org/jpatterns/gof/TemplateMethodPattern.java | 2 +- src/main/java/org/jpatterns/gof/VisitorPattern.java | 2 +- .../java/org/jpatterns/jee/BusinessDelegatePattern.java | 4 ++-- .../java/org/jpatterns/jee/DataAccessObjectPattern.java | 4 ++-- src/main/java/org/jpatterns/jee/ModelViewController.java | 4 ++-- 23 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/main/java/org/jpatterns/gof/AbstractFactoryPattern.java b/src/main/java/org/jpatterns/gof/AbstractFactoryPattern.java index a93b5de..1aa863b 100644 --- a/src/main/java/org/jpatterns/gof/AbstractFactoryPattern.java +++ b/src/main/java/org/jpatterns/gof/AbstractFactoryPattern.java @@ -7,9 +7,9 @@ /** * Intent [GoF, pg 87]: Provide an interface for creating families of * related or dependent objects without specifying their concrete classes. - *

+ * * - *

+ * * * * @author Heinz Kabutz, Michael Hunger diff --git a/src/main/java/org/jpatterns/gof/AdapterPattern.java b/src/main/java/org/jpatterns/gof/AdapterPattern.java index 860c613..faad588 100644 --- a/src/main/java/org/jpatterns/gof/AdapterPattern.java +++ b/src/main/java/org/jpatterns/gof/AdapterPattern.java @@ -8,13 +8,13 @@ * Intent [GoF, pg 139]: Convert the interface of a class into another * interface clients expect. Adapter lets classes work together that couldn't * otherwise because of incompatible interfaces. - *

+ * * The structure for an object adapter is: - *

+ * * - *

+ * * The structure for a class adapter is: - *

+ * * * * @author Heinz Kabutz diff --git a/src/main/java/org/jpatterns/gof/BridgePattern.java b/src/main/java/org/jpatterns/gof/BridgePattern.java index 92056e3..60decc0 100644 --- a/src/main/java/org/jpatterns/gof/BridgePattern.java +++ b/src/main/java/org/jpatterns/gof/BridgePattern.java @@ -7,7 +7,7 @@ /** * Intent [GoF, pg 151]: Decouple an abstraction from its implementation * so that the two can vary independently. - *

+ * * * * @author Heinz Kabutz diff --git a/src/main/java/org/jpatterns/gof/ChainOfResponsibilityPattern.java b/src/main/java/org/jpatterns/gof/ChainOfResponsibilityPattern.java index 6a2fc8c..542d0a7 100644 --- a/src/main/java/org/jpatterns/gof/ChainOfResponsibilityPattern.java +++ b/src/main/java/org/jpatterns/gof/ChainOfResponsibilityPattern.java @@ -9,7 +9,7 @@ * receiver by giving more than one object a chance to handle the request. Chain * the receiving objects and pass the request along the chain until an object * handles it. - *

+ * * * * @author Heinz Kabutz diff --git a/src/main/java/org/jpatterns/gof/CommandPattern.java b/src/main/java/org/jpatterns/gof/CommandPattern.java index a4e763b..c37c46f 100644 --- a/src/main/java/org/jpatterns/gof/CommandPattern.java +++ b/src/main/java/org/jpatterns/gof/CommandPattern.java @@ -8,7 +8,7 @@ * Intent [GoF, pg 233]: Encapsulate a request as an object, thereby * letting you parameterize clients with different requests, queue or log * requests, and support undoable operations. - *

+ * * * * @author Michael Hunger diff --git a/src/main/java/org/jpatterns/gof/CompositePattern.java b/src/main/java/org/jpatterns/gof/CompositePattern.java index 6e507bb..7db34d9 100644 --- a/src/main/java/org/jpatterns/gof/CompositePattern.java +++ b/src/main/java/org/jpatterns/gof/CompositePattern.java @@ -8,7 +8,7 @@ * Intent [GoF, pg 163]: Compose objects into tree structures to * represent whole-part hierarchies. Composite lets clients treat individual * objects and compositions of objects uniformly. - *

+ * * * * @author Heinz Kabutz diff --git a/src/main/java/org/jpatterns/gof/DecoratorPattern.java b/src/main/java/org/jpatterns/gof/DecoratorPattern.java index 4311abd..d31d590 100644 --- a/src/main/java/org/jpatterns/gof/DecoratorPattern.java +++ b/src/main/java/org/jpatterns/gof/DecoratorPattern.java @@ -8,7 +8,7 @@ * Intent [GoF, pg 175]: Attach additional responsibilities to an object * dynamically. Decorators provide a flexible alternative to subclassing for * extending functionality. - *

+ * * * * @author Heinz Kabutz diff --git a/src/main/java/org/jpatterns/gof/FacadePattern.java b/src/main/java/org/jpatterns/gof/FacadePattern.java index fdaf769..e3e4d7e 100644 --- a/src/main/java/org/jpatterns/gof/FacadePattern.java +++ b/src/main/java/org/jpatterns/gof/FacadePattern.java @@ -8,7 +8,7 @@ * Intent [GoF, pg 185]: Provide a unified interface to a set of * interfaces in a subsystem. Facade defines a higher-level interface that makes * the subsystem easier to use. - *

+ * * * * @author Heinz Kabutz diff --git a/src/main/java/org/jpatterns/gof/FactoryMethodPattern.java b/src/main/java/org/jpatterns/gof/FactoryMethodPattern.java index de15c0c..ce59105 100644 --- a/src/main/java/org/jpatterns/gof/FactoryMethodPattern.java +++ b/src/main/java/org/jpatterns/gof/FactoryMethodPattern.java @@ -8,10 +8,10 @@ * Intent [GoF, pg 107]: Define an interface for creating an object, but * let subclasses decide which class to instantiate. Factory Method lets a class * defer instantiation to subclasses. - *

+ * * This pattern refers to the GoF factory method, which differs greatly from the * static factory method commonly found in the refactoring literature. - *

+ * * * * @author Heinz Kabutz diff --git a/src/main/java/org/jpatterns/gof/FlyweightPattern.java b/src/main/java/org/jpatterns/gof/FlyweightPattern.java index f8e18e8..2bbb826 100644 --- a/src/main/java/org/jpatterns/gof/FlyweightPattern.java +++ b/src/main/java/org/jpatterns/gof/FlyweightPattern.java @@ -7,7 +7,7 @@ /** * Intent [GoF, pg 195]: Use sharing to support large numbers of * fine-grained objects efficiently. - *

+ * * * * @author Heinz Kabutz diff --git a/src/main/java/org/jpatterns/gof/IteratorPattern.java b/src/main/java/org/jpatterns/gof/IteratorPattern.java index f7ebd64..81093fc 100644 --- a/src/main/java/org/jpatterns/gof/IteratorPattern.java +++ b/src/main/java/org/jpatterns/gof/IteratorPattern.java @@ -7,7 +7,7 @@ /** * Intent [GoF, pg 257]: Provide a way to access the elements of an * aggregate object sequentially without exposing its underlying representation. - *

+ * * * * @author Heinz Kabutz diff --git a/src/main/java/org/jpatterns/gof/MediatorPattern.java b/src/main/java/org/jpatterns/gof/MediatorPattern.java index bf28af2..96d4970 100644 --- a/src/main/java/org/jpatterns/gof/MediatorPattern.java +++ b/src/main/java/org/jpatterns/gof/MediatorPattern.java @@ -9,7 +9,7 @@ * objects interact. Mediator promotes loose coupling by keeping objects from * referring to each other explicitly, and it lets you vary their interaction * independently. - *

+ * * * * @author Heinz Kabutz diff --git a/src/main/java/org/jpatterns/gof/MementoPattern.java b/src/main/java/org/jpatterns/gof/MementoPattern.java index ec10d78..57740f9 100644 --- a/src/main/java/org/jpatterns/gof/MementoPattern.java +++ b/src/main/java/org/jpatterns/gof/MementoPattern.java @@ -8,7 +8,7 @@ * Intent [GoF, pg 283]: Without violating encapsulation, capture and * externalize an object's internal state so that the object can be restored to * this state later. - *

+ * * * * @author Heinz Kabutz diff --git a/src/main/java/org/jpatterns/gof/ObserverPattern.java b/src/main/java/org/jpatterns/gof/ObserverPattern.java index 77c7bb7..c02ba91 100644 --- a/src/main/java/org/jpatterns/gof/ObserverPattern.java +++ b/src/main/java/org/jpatterns/gof/ObserverPattern.java @@ -8,7 +8,7 @@ * Intent [GoF, pg 293]: Define a one-to-many dependency between objects * so that when one object changes state, all its dependents are notified and * updated automatically. - *

+ * * * * @author Heinz Kabutz diff --git a/src/main/java/org/jpatterns/gof/ProxyPattern.java b/src/main/java/org/jpatterns/gof/ProxyPattern.java index 8ca53cd..8a16c9e 100644 --- a/src/main/java/org/jpatterns/gof/ProxyPattern.java +++ b/src/main/java/org/jpatterns/gof/ProxyPattern.java @@ -7,7 +7,7 @@ /** * Intent [GoF, pg 207]: Provide a surrogate or placeholder for another * object to control access to it. - *

+ * * * * @author Heinz Kabutz diff --git a/src/main/java/org/jpatterns/gof/SingletonPattern.java b/src/main/java/org/jpatterns/gof/SingletonPattern.java index a910849..7c68692 100644 --- a/src/main/java/org/jpatterns/gof/SingletonPattern.java +++ b/src/main/java/org/jpatterns/gof/SingletonPattern.java @@ -7,7 +7,7 @@ /** * Intent [GoF, pg 127]: Ensure a class only has one instance, and * provide a global point of access to it. - *

+ * * * * @author Alex Gout diff --git a/src/main/java/org/jpatterns/gof/StatePattern.java b/src/main/java/org/jpatterns/gof/StatePattern.java index 14bdb77..42db8d6 100644 --- a/src/main/java/org/jpatterns/gof/StatePattern.java +++ b/src/main/java/org/jpatterns/gof/StatePattern.java @@ -7,7 +7,7 @@ /** * Intent [GoF, pg 305]: Allow an object to alter its behavior when its * internal state changes. The object will appear to change its class. - *

+ * * * * @author Heinz Kabutz diff --git a/src/main/java/org/jpatterns/gof/StrategyPattern.java b/src/main/java/org/jpatterns/gof/StrategyPattern.java index 96432b6..cc2dc54 100644 --- a/src/main/java/org/jpatterns/gof/StrategyPattern.java +++ b/src/main/java/org/jpatterns/gof/StrategyPattern.java @@ -8,7 +8,7 @@ * Intent [GoF, pg 315]: Define a family of algorithms, encapsulate each * one, and make them interchangeable. Strategy lets the algorithm vary * independently from clients that use it. - *

+ * * * * @author Heinz Kabutz diff --git a/src/main/java/org/jpatterns/gof/TemplateMethodPattern.java b/src/main/java/org/jpatterns/gof/TemplateMethodPattern.java index cffdf86..707864b 100644 --- a/src/main/java/org/jpatterns/gof/TemplateMethodPattern.java +++ b/src/main/java/org/jpatterns/gof/TemplateMethodPattern.java @@ -9,7 +9,7 @@ * operation, deferring some steps to subclasses. Template Method lets * subclasses redefine certain steps of an algorithm without changing the * algorithm's structure. - *

+ * * * * @author Heinz Kabutz diff --git a/src/main/java/org/jpatterns/gof/VisitorPattern.java b/src/main/java/org/jpatterns/gof/VisitorPattern.java index 945480c..5227abf 100644 --- a/src/main/java/org/jpatterns/gof/VisitorPattern.java +++ b/src/main/java/org/jpatterns/gof/VisitorPattern.java @@ -8,7 +8,7 @@ * Intent [GoF, pg 331]: Represent an operation to be performed on the * elements of an object structure. Visitor lets you define a new operation * without changing the classes of the elements on which it operates. - *

+ * * * * @author Heinz Kabutz diff --git a/src/main/java/org/jpatterns/jee/BusinessDelegatePattern.java b/src/main/java/org/jpatterns/jee/BusinessDelegatePattern.java index 3944053..55361b1 100644 --- a/src/main/java/org/jpatterns/jee/BusinessDelegatePattern.java +++ b/src/main/java/org/jpatterns/jee/BusinessDelegatePattern.java @@ -14,9 +14,9 @@ * coupling between presentation-tier clients and business services. The * BusinessDelegate hides the underlying implementation details of the business * service [...]. - *

+ * * - *

+ * * * @author Marco Tedone * @since 2010-08-21 diff --git a/src/main/java/org/jpatterns/jee/DataAccessObjectPattern.java b/src/main/java/org/jpatterns/jee/DataAccessObjectPattern.java index 928c27e..fe95b75 100644 --- a/src/main/java/org/jpatterns/jee/DataAccessObjectPattern.java +++ b/src/main/java/org/jpatterns/jee/DataAccessObjectPattern.java @@ -11,9 +11,9 @@ * Intent [Core J2EE Patterns, pg 391]: Abstract and encapsulate all * access to the data source. The DAO manages the connection with the data * source to obtain and store data - *

+ * * - *

+ * * * @author Marco Tedone * @since 2010-08-19 diff --git a/src/main/java/org/jpatterns/jee/ModelViewController.java b/src/main/java/org/jpatterns/jee/ModelViewController.java index 07a9a85..d6ec96c 100644 --- a/src/main/java/org/jpatterns/jee/ModelViewController.java +++ b/src/main/java/org/jpatterns/jee/ModelViewController.java @@ -15,9 +15,9 @@ *

  • The Model wraps the logic and the domain model of the application, * offering both services and objects to the view
  • . * - *

    + * * - *

    + * * * @author Marco Tedone * @since 2010-08-21 From 9bd8a99bd8c267e9558a5d69c10a62d3be2a900e Mon Sep 17 00:00:00 2001 From: "Dr Heinz M. Kabutz" Date: Tue, 11 Jun 2019 16:19:08 +0300 Subject: [PATCH 03/10] added "alt" tag for images --- src/main/java/org/jpatterns/gof/AbstractFactoryPattern.java | 4 ++-- src/main/java/org/jpatterns/gof/AdapterPattern.java | 4 ++-- src/main/java/org/jpatterns/gof/BridgePattern.java | 2 +- .../java/org/jpatterns/gof/ChainOfResponsibilityPattern.java | 2 +- src/main/java/org/jpatterns/gof/CommandPattern.java | 2 +- src/main/java/org/jpatterns/gof/CompositePattern.java | 2 +- src/main/java/org/jpatterns/gof/DecoratorPattern.java | 2 +- src/main/java/org/jpatterns/gof/FacadePattern.java | 2 +- src/main/java/org/jpatterns/gof/FactoryMethodPattern.java | 2 +- src/main/java/org/jpatterns/gof/FlyweightPattern.java | 2 +- src/main/java/org/jpatterns/gof/IteratorPattern.java | 2 +- src/main/java/org/jpatterns/gof/MediatorPattern.java | 2 +- src/main/java/org/jpatterns/gof/MementoPattern.java | 2 +- src/main/java/org/jpatterns/gof/ObserverPattern.java | 2 +- src/main/java/org/jpatterns/gof/ProxyPattern.java | 2 +- src/main/java/org/jpatterns/gof/SingletonPattern.java | 2 +- src/main/java/org/jpatterns/gof/StatePattern.java | 2 +- src/main/java/org/jpatterns/gof/StrategyPattern.java | 2 +- src/main/java/org/jpatterns/gof/TemplateMethodPattern.java | 2 +- src/main/java/org/jpatterns/gof/VisitorPattern.java | 2 +- src/main/java/org/jpatterns/jee/BusinessDelegatePattern.java | 2 +- src/main/java/org/jpatterns/jee/DataAccessObjectPattern.java | 2 +- src/main/java/org/jpatterns/jee/ModelViewController.java | 4 ++-- 23 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/main/java/org/jpatterns/gof/AbstractFactoryPattern.java b/src/main/java/org/jpatterns/gof/AbstractFactoryPattern.java index 1aa863b..f901e82 100644 --- a/src/main/java/org/jpatterns/gof/AbstractFactoryPattern.java +++ b/src/main/java/org/jpatterns/gof/AbstractFactoryPattern.java @@ -8,9 +8,9 @@ * Intent [GoF, pg 87]: Provide an interface for creating families of * related or dependent objects without specifying their concrete classes. * - * + * Abstract Factory Structure * - * + * Abstract Factory User View Structure * * @author Heinz Kabutz, Michael Hunger * @since 2010-08-09 diff --git a/src/main/java/org/jpatterns/gof/AdapterPattern.java b/src/main/java/org/jpatterns/gof/AdapterPattern.java index faad588..99c1a84 100644 --- a/src/main/java/org/jpatterns/gof/AdapterPattern.java +++ b/src/main/java/org/jpatterns/gof/AdapterPattern.java @@ -11,11 +11,11 @@ * * The structure for an object adapter is: * - * + * Object Adapter Structure * * The structure for a class adapter is: * - * + * Class Adapter Structure * * @author Heinz Kabutz * @since 2010-07-28 diff --git a/src/main/java/org/jpatterns/gof/BridgePattern.java b/src/main/java/org/jpatterns/gof/BridgePattern.java index 60decc0..48ed42a 100644 --- a/src/main/java/org/jpatterns/gof/BridgePattern.java +++ b/src/main/java/org/jpatterns/gof/BridgePattern.java @@ -8,7 +8,7 @@ * Intent [GoF, pg 151]: Decouple an abstraction from its implementation * so that the two can vary independently. * - * + * Bridge Structure * * @author Heinz Kabutz * @since 2010-07-28 diff --git a/src/main/java/org/jpatterns/gof/ChainOfResponsibilityPattern.java b/src/main/java/org/jpatterns/gof/ChainOfResponsibilityPattern.java index 542d0a7..fbcb02f 100644 --- a/src/main/java/org/jpatterns/gof/ChainOfResponsibilityPattern.java +++ b/src/main/java/org/jpatterns/gof/ChainOfResponsibilityPattern.java @@ -10,7 +10,7 @@ * the receiving objects and pass the request along the chain until an object * handles it. * - * + * Chain Of Responsibility Structure * * @author Heinz Kabutz * @since 2010-07-28 diff --git a/src/main/java/org/jpatterns/gof/CommandPattern.java b/src/main/java/org/jpatterns/gof/CommandPattern.java index c37c46f..7139035 100644 --- a/src/main/java/org/jpatterns/gof/CommandPattern.java +++ b/src/main/java/org/jpatterns/gof/CommandPattern.java @@ -9,7 +9,7 @@ * letting you parameterize clients with different requests, queue or log * requests, and support undoable operations. * - * + * Command Structure * * @author Michael Hunger * @since 2010-08-08 diff --git a/src/main/java/org/jpatterns/gof/CompositePattern.java b/src/main/java/org/jpatterns/gof/CompositePattern.java index 7db34d9..a9cbaa1 100644 --- a/src/main/java/org/jpatterns/gof/CompositePattern.java +++ b/src/main/java/org/jpatterns/gof/CompositePattern.java @@ -9,7 +9,7 @@ * represent whole-part hierarchies. Composite lets clients treat individual * objects and compositions of objects uniformly. * - * + * Composite Structure * * @author Heinz Kabutz * @since 2010-07-28 diff --git a/src/main/java/org/jpatterns/gof/DecoratorPattern.java b/src/main/java/org/jpatterns/gof/DecoratorPattern.java index d31d590..26efacb 100644 --- a/src/main/java/org/jpatterns/gof/DecoratorPattern.java +++ b/src/main/java/org/jpatterns/gof/DecoratorPattern.java @@ -9,7 +9,7 @@ * dynamically. Decorators provide a flexible alternative to subclassing for * extending functionality. * - * + * Decorator Structure * * @author Heinz Kabutz * @since 2010-08-09 diff --git a/src/main/java/org/jpatterns/gof/FacadePattern.java b/src/main/java/org/jpatterns/gof/FacadePattern.java index e3e4d7e..27edf0e 100644 --- a/src/main/java/org/jpatterns/gof/FacadePattern.java +++ b/src/main/java/org/jpatterns/gof/FacadePattern.java @@ -9,7 +9,7 @@ * interfaces in a subsystem. Facade defines a higher-level interface that makes * the subsystem easier to use. * - * + * Facade Structure * * @author Heinz Kabutz * @since 2010-07-28 diff --git a/src/main/java/org/jpatterns/gof/FactoryMethodPattern.java b/src/main/java/org/jpatterns/gof/FactoryMethodPattern.java index ce59105..baa41bc 100644 --- a/src/main/java/org/jpatterns/gof/FactoryMethodPattern.java +++ b/src/main/java/org/jpatterns/gof/FactoryMethodPattern.java @@ -12,7 +12,7 @@ * This pattern refers to the GoF factory method, which differs greatly from the * static factory method commonly found in the refactoring literature. * - * + * Factory Method Structure * * @author Heinz Kabutz * @since 2010-08-09 diff --git a/src/main/java/org/jpatterns/gof/FlyweightPattern.java b/src/main/java/org/jpatterns/gof/FlyweightPattern.java index 2bbb826..6862620 100644 --- a/src/main/java/org/jpatterns/gof/FlyweightPattern.java +++ b/src/main/java/org/jpatterns/gof/FlyweightPattern.java @@ -8,7 +8,7 @@ * Intent [GoF, pg 195]: Use sharing to support large numbers of * fine-grained objects efficiently. * - * + * Flyweight Structure * * @author Heinz Kabutz * @since 2010-07-28 diff --git a/src/main/java/org/jpatterns/gof/IteratorPattern.java b/src/main/java/org/jpatterns/gof/IteratorPattern.java index 81093fc..0c0f05f 100644 --- a/src/main/java/org/jpatterns/gof/IteratorPattern.java +++ b/src/main/java/org/jpatterns/gof/IteratorPattern.java @@ -8,7 +8,7 @@ * Intent [GoF, pg 257]: Provide a way to access the elements of an * aggregate object sequentially without exposing its underlying representation. * - * + * Iterator Structure * * @author Heinz Kabutz * @since 2010-08-09 diff --git a/src/main/java/org/jpatterns/gof/MediatorPattern.java b/src/main/java/org/jpatterns/gof/MediatorPattern.java index 96d4970..adc15a0 100644 --- a/src/main/java/org/jpatterns/gof/MediatorPattern.java +++ b/src/main/java/org/jpatterns/gof/MediatorPattern.java @@ -10,7 +10,7 @@ * referring to each other explicitly, and it lets you vary their interaction * independently. * - * + * Mediator Structure * * @author Heinz Kabutz * @since 2010-08-09 diff --git a/src/main/java/org/jpatterns/gof/MementoPattern.java b/src/main/java/org/jpatterns/gof/MementoPattern.java index 57740f9..e1ac12a 100644 --- a/src/main/java/org/jpatterns/gof/MementoPattern.java +++ b/src/main/java/org/jpatterns/gof/MementoPattern.java @@ -9,7 +9,7 @@ * externalize an object's internal state so that the object can be restored to * this state later. * - * + * Memento Structure * * @author Heinz Kabutz * @since 2010-08-09 diff --git a/src/main/java/org/jpatterns/gof/ObserverPattern.java b/src/main/java/org/jpatterns/gof/ObserverPattern.java index c02ba91..cea8efe 100644 --- a/src/main/java/org/jpatterns/gof/ObserverPattern.java +++ b/src/main/java/org/jpatterns/gof/ObserverPattern.java @@ -9,7 +9,7 @@ * so that when one object changes state, all its dependents are notified and * updated automatically. * - * + * Observer Structure * * @author Heinz Kabutz * @since 2010-08-09 diff --git a/src/main/java/org/jpatterns/gof/ProxyPattern.java b/src/main/java/org/jpatterns/gof/ProxyPattern.java index 8a16c9e..47095d4 100644 --- a/src/main/java/org/jpatterns/gof/ProxyPattern.java +++ b/src/main/java/org/jpatterns/gof/ProxyPattern.java @@ -8,7 +8,7 @@ * Intent [GoF, pg 207]: Provide a surrogate or placeholder for another * object to control access to it. * - * + * Proxy Structure * * @author Heinz Kabutz * @since 2010-07-28 diff --git a/src/main/java/org/jpatterns/gof/SingletonPattern.java b/src/main/java/org/jpatterns/gof/SingletonPattern.java index 7c68692..b1c5a77 100644 --- a/src/main/java/org/jpatterns/gof/SingletonPattern.java +++ b/src/main/java/org/jpatterns/gof/SingletonPattern.java @@ -8,7 +8,7 @@ * Intent [GoF, pg 127]: Ensure a class only has one instance, and * provide a global point of access to it. * - * + * Singleton Structure * * @author Alex Gout * @since 2010-08-08 diff --git a/src/main/java/org/jpatterns/gof/StatePattern.java b/src/main/java/org/jpatterns/gof/StatePattern.java index 42db8d6..882d68a 100644 --- a/src/main/java/org/jpatterns/gof/StatePattern.java +++ b/src/main/java/org/jpatterns/gof/StatePattern.java @@ -8,7 +8,7 @@ * Intent [GoF, pg 305]: Allow an object to alter its behavior when its * internal state changes. The object will appear to change its class. * - * + * State Structure * * @author Heinz Kabutz * @since 2010-08-09 diff --git a/src/main/java/org/jpatterns/gof/StrategyPattern.java b/src/main/java/org/jpatterns/gof/StrategyPattern.java index cc2dc54..3795957 100644 --- a/src/main/java/org/jpatterns/gof/StrategyPattern.java +++ b/src/main/java/org/jpatterns/gof/StrategyPattern.java @@ -9,7 +9,7 @@ * one, and make them interchangeable. Strategy lets the algorithm vary * independently from clients that use it. * - * + * Strategy Structure * * @author Heinz Kabutz * @since 2010-07-28 diff --git a/src/main/java/org/jpatterns/gof/TemplateMethodPattern.java b/src/main/java/org/jpatterns/gof/TemplateMethodPattern.java index 707864b..a019f3d 100644 --- a/src/main/java/org/jpatterns/gof/TemplateMethodPattern.java +++ b/src/main/java/org/jpatterns/gof/TemplateMethodPattern.java @@ -10,7 +10,7 @@ * subclasses redefine certain steps of an algorithm without changing the * algorithm's structure. * - * + * Template Method Structure * * @author Heinz Kabutz * @since 2010-07-28 diff --git a/src/main/java/org/jpatterns/gof/VisitorPattern.java b/src/main/java/org/jpatterns/gof/VisitorPattern.java index 5227abf..71b5de8 100644 --- a/src/main/java/org/jpatterns/gof/VisitorPattern.java +++ b/src/main/java/org/jpatterns/gof/VisitorPattern.java @@ -9,7 +9,7 @@ * elements of an object structure. Visitor lets you define a new operation * without changing the classes of the elements on which it operates. * - * + * Visitor Structure * * @author Heinz Kabutz * @since 2010-08-09 diff --git a/src/main/java/org/jpatterns/jee/BusinessDelegatePattern.java b/src/main/java/org/jpatterns/jee/BusinessDelegatePattern.java index 55361b1..11eb50f 100644 --- a/src/main/java/org/jpatterns/jee/BusinessDelegatePattern.java +++ b/src/main/java/org/jpatterns/jee/BusinessDelegatePattern.java @@ -15,7 +15,7 @@ * BusinessDelegate hides the underlying implementation details of the business * service [...]. * - * + * Business Delegate Structure * * * @author Marco Tedone diff --git a/src/main/java/org/jpatterns/jee/DataAccessObjectPattern.java b/src/main/java/org/jpatterns/jee/DataAccessObjectPattern.java index fe95b75..cea3b54 100644 --- a/src/main/java/org/jpatterns/jee/DataAccessObjectPattern.java +++ b/src/main/java/org/jpatterns/jee/DataAccessObjectPattern.java @@ -12,7 +12,7 @@ * access to the data source. The DAO manages the connection with the data * source to obtain and store data * - * + * DAO Structure * * * @author Marco Tedone diff --git a/src/main/java/org/jpatterns/jee/ModelViewController.java b/src/main/java/org/jpatterns/jee/ModelViewController.java index d6ec96c..0fee787 100644 --- a/src/main/java/org/jpatterns/jee/ModelViewController.java +++ b/src/main/java/org/jpatterns/jee/ModelViewController.java @@ -16,7 +16,7 @@ * offering both services and objects to the view. * * - * + * MVC Structure * * * @author Marco Tedone @@ -58,4 +58,4 @@ String comment() default ""; } -} \ No newline at end of file +} From 08d452c49a3d710508faff84e95f7581f4795b15 Mon Sep 17 00:00:00 2001 From: "Dr Heinz M. Kabutz" Date: Tue, 11 Jun 2019 16:25:26 +0300 Subject: [PATCH 04/10] Changed tags to not close in line with new JavaDoc standards --- src/main/java/org/jpatterns/gof/AbstractFactoryPattern.java | 4 ++-- src/main/java/org/jpatterns/gof/AdapterPattern.java | 4 ++-- src/main/java/org/jpatterns/gof/BridgePattern.java | 2 +- .../java/org/jpatterns/gof/ChainOfResponsibilityPattern.java | 2 +- src/main/java/org/jpatterns/gof/CommandPattern.java | 2 +- src/main/java/org/jpatterns/gof/CompositePattern.java | 2 +- src/main/java/org/jpatterns/gof/DecoratorPattern.java | 2 +- src/main/java/org/jpatterns/gof/FacadePattern.java | 2 +- src/main/java/org/jpatterns/gof/FactoryMethodPattern.java | 2 +- src/main/java/org/jpatterns/gof/FlyweightPattern.java | 2 +- src/main/java/org/jpatterns/gof/IteratorPattern.java | 2 +- src/main/java/org/jpatterns/gof/MediatorPattern.java | 2 +- src/main/java/org/jpatterns/gof/MementoPattern.java | 2 +- src/main/java/org/jpatterns/gof/ObserverPattern.java | 2 +- src/main/java/org/jpatterns/gof/ProxyPattern.java | 2 +- src/main/java/org/jpatterns/gof/SingletonPattern.java | 2 +- src/main/java/org/jpatterns/gof/StatePattern.java | 2 +- src/main/java/org/jpatterns/gof/StrategyPattern.java | 2 +- src/main/java/org/jpatterns/gof/TemplateMethodPattern.java | 2 +- src/main/java/org/jpatterns/gof/VisitorPattern.java | 2 +- src/main/java/org/jpatterns/jee/BusinessDelegatePattern.java | 2 +- src/main/java/org/jpatterns/jee/DataAccessObjectPattern.java | 2 +- src/main/java/org/jpatterns/jee/ModelViewController.java | 2 +- 23 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/main/java/org/jpatterns/gof/AbstractFactoryPattern.java b/src/main/java/org/jpatterns/gof/AbstractFactoryPattern.java index f901e82..32af6df 100644 --- a/src/main/java/org/jpatterns/gof/AbstractFactoryPattern.java +++ b/src/main/java/org/jpatterns/gof/AbstractFactoryPattern.java @@ -8,9 +8,9 @@ * Intent [GoF, pg 87]: Provide an interface for creating families of * related or dependent objects without specifying their concrete classes. * - * Abstract Factory Structure + * Abstract Factory Structure * - * Abstract Factory User View Structure + * Abstract Factory User View Structure * * @author Heinz Kabutz, Michael Hunger * @since 2010-08-09 diff --git a/src/main/java/org/jpatterns/gof/AdapterPattern.java b/src/main/java/org/jpatterns/gof/AdapterPattern.java index 99c1a84..0af050a 100644 --- a/src/main/java/org/jpatterns/gof/AdapterPattern.java +++ b/src/main/java/org/jpatterns/gof/AdapterPattern.java @@ -11,11 +11,11 @@ * * The structure for an object adapter is: * - * Object Adapter Structure + * Object Adapter Structure * * The structure for a class adapter is: * - * Class Adapter Structure + * Class Adapter Structure * * @author Heinz Kabutz * @since 2010-07-28 diff --git a/src/main/java/org/jpatterns/gof/BridgePattern.java b/src/main/java/org/jpatterns/gof/BridgePattern.java index 48ed42a..9d30d14 100644 --- a/src/main/java/org/jpatterns/gof/BridgePattern.java +++ b/src/main/java/org/jpatterns/gof/BridgePattern.java @@ -8,7 +8,7 @@ * Intent [GoF, pg 151]: Decouple an abstraction from its implementation * so that the two can vary independently. * - * Bridge Structure + * Bridge Structure * * @author Heinz Kabutz * @since 2010-07-28 diff --git a/src/main/java/org/jpatterns/gof/ChainOfResponsibilityPattern.java b/src/main/java/org/jpatterns/gof/ChainOfResponsibilityPattern.java index fbcb02f..4e6f654 100644 --- a/src/main/java/org/jpatterns/gof/ChainOfResponsibilityPattern.java +++ b/src/main/java/org/jpatterns/gof/ChainOfResponsibilityPattern.java @@ -10,7 +10,7 @@ * the receiving objects and pass the request along the chain until an object * handles it. * - * Chain Of Responsibility Structure + * Chain Of Responsibility Structure * * @author Heinz Kabutz * @since 2010-07-28 diff --git a/src/main/java/org/jpatterns/gof/CommandPattern.java b/src/main/java/org/jpatterns/gof/CommandPattern.java index 7139035..c03e895 100644 --- a/src/main/java/org/jpatterns/gof/CommandPattern.java +++ b/src/main/java/org/jpatterns/gof/CommandPattern.java @@ -9,7 +9,7 @@ * letting you parameterize clients with different requests, queue or log * requests, and support undoable operations. * - * Command Structure + * Command Structure * * @author Michael Hunger * @since 2010-08-08 diff --git a/src/main/java/org/jpatterns/gof/CompositePattern.java b/src/main/java/org/jpatterns/gof/CompositePattern.java index a9cbaa1..57e2add 100644 --- a/src/main/java/org/jpatterns/gof/CompositePattern.java +++ b/src/main/java/org/jpatterns/gof/CompositePattern.java @@ -9,7 +9,7 @@ * represent whole-part hierarchies. Composite lets clients treat individual * objects and compositions of objects uniformly. * - * Composite Structure + * Composite Structure * * @author Heinz Kabutz * @since 2010-07-28 diff --git a/src/main/java/org/jpatterns/gof/DecoratorPattern.java b/src/main/java/org/jpatterns/gof/DecoratorPattern.java index 26efacb..4cf3bd4 100644 --- a/src/main/java/org/jpatterns/gof/DecoratorPattern.java +++ b/src/main/java/org/jpatterns/gof/DecoratorPattern.java @@ -9,7 +9,7 @@ * dynamically. Decorators provide a flexible alternative to subclassing for * extending functionality. * - * Decorator Structure + * Decorator Structure * * @author Heinz Kabutz * @since 2010-08-09 diff --git a/src/main/java/org/jpatterns/gof/FacadePattern.java b/src/main/java/org/jpatterns/gof/FacadePattern.java index 27edf0e..7177c2a 100644 --- a/src/main/java/org/jpatterns/gof/FacadePattern.java +++ b/src/main/java/org/jpatterns/gof/FacadePattern.java @@ -9,7 +9,7 @@ * interfaces in a subsystem. Facade defines a higher-level interface that makes * the subsystem easier to use. * - * Facade Structure + * Facade Structure * * @author Heinz Kabutz * @since 2010-07-28 diff --git a/src/main/java/org/jpatterns/gof/FactoryMethodPattern.java b/src/main/java/org/jpatterns/gof/FactoryMethodPattern.java index baa41bc..bc5fd2a 100644 --- a/src/main/java/org/jpatterns/gof/FactoryMethodPattern.java +++ b/src/main/java/org/jpatterns/gof/FactoryMethodPattern.java @@ -12,7 +12,7 @@ * This pattern refers to the GoF factory method, which differs greatly from the * static factory method commonly found in the refactoring literature. * - * Factory Method Structure + * Factory Method Structure * * @author Heinz Kabutz * @since 2010-08-09 diff --git a/src/main/java/org/jpatterns/gof/FlyweightPattern.java b/src/main/java/org/jpatterns/gof/FlyweightPattern.java index 6862620..90342e8 100644 --- a/src/main/java/org/jpatterns/gof/FlyweightPattern.java +++ b/src/main/java/org/jpatterns/gof/FlyweightPattern.java @@ -8,7 +8,7 @@ * Intent [GoF, pg 195]: Use sharing to support large numbers of * fine-grained objects efficiently. * - * Flyweight Structure + * Flyweight Structure * * @author Heinz Kabutz * @since 2010-07-28 diff --git a/src/main/java/org/jpatterns/gof/IteratorPattern.java b/src/main/java/org/jpatterns/gof/IteratorPattern.java index 0c0f05f..0410fea 100644 --- a/src/main/java/org/jpatterns/gof/IteratorPattern.java +++ b/src/main/java/org/jpatterns/gof/IteratorPattern.java @@ -8,7 +8,7 @@ * Intent [GoF, pg 257]: Provide a way to access the elements of an * aggregate object sequentially without exposing its underlying representation. * - * Iterator Structure + * Iterator Structure * * @author Heinz Kabutz * @since 2010-08-09 diff --git a/src/main/java/org/jpatterns/gof/MediatorPattern.java b/src/main/java/org/jpatterns/gof/MediatorPattern.java index adc15a0..fdc0c63 100644 --- a/src/main/java/org/jpatterns/gof/MediatorPattern.java +++ b/src/main/java/org/jpatterns/gof/MediatorPattern.java @@ -10,7 +10,7 @@ * referring to each other explicitly, and it lets you vary their interaction * independently. * - * Mediator Structure + * Mediator Structure * * @author Heinz Kabutz * @since 2010-08-09 diff --git a/src/main/java/org/jpatterns/gof/MementoPattern.java b/src/main/java/org/jpatterns/gof/MementoPattern.java index e1ac12a..59853ee 100644 --- a/src/main/java/org/jpatterns/gof/MementoPattern.java +++ b/src/main/java/org/jpatterns/gof/MementoPattern.java @@ -9,7 +9,7 @@ * externalize an object's internal state so that the object can be restored to * this state later. * - * Memento Structure + * Memento Structure * * @author Heinz Kabutz * @since 2010-08-09 diff --git a/src/main/java/org/jpatterns/gof/ObserverPattern.java b/src/main/java/org/jpatterns/gof/ObserverPattern.java index cea8efe..2213c3c 100644 --- a/src/main/java/org/jpatterns/gof/ObserverPattern.java +++ b/src/main/java/org/jpatterns/gof/ObserverPattern.java @@ -9,7 +9,7 @@ * so that when one object changes state, all its dependents are notified and * updated automatically. * - * Observer Structure + * Observer Structure * * @author Heinz Kabutz * @since 2010-08-09 diff --git a/src/main/java/org/jpatterns/gof/ProxyPattern.java b/src/main/java/org/jpatterns/gof/ProxyPattern.java index 47095d4..c4e4c13 100644 --- a/src/main/java/org/jpatterns/gof/ProxyPattern.java +++ b/src/main/java/org/jpatterns/gof/ProxyPattern.java @@ -8,7 +8,7 @@ * Intent [GoF, pg 207]: Provide a surrogate or placeholder for another * object to control access to it. * - * Proxy Structure + * Proxy Structure * * @author Heinz Kabutz * @since 2010-07-28 diff --git a/src/main/java/org/jpatterns/gof/SingletonPattern.java b/src/main/java/org/jpatterns/gof/SingletonPattern.java index b1c5a77..81024ad 100644 --- a/src/main/java/org/jpatterns/gof/SingletonPattern.java +++ b/src/main/java/org/jpatterns/gof/SingletonPattern.java @@ -8,7 +8,7 @@ * Intent [GoF, pg 127]: Ensure a class only has one instance, and * provide a global point of access to it. * - * Singleton Structure + * Singleton Structure * * @author Alex Gout * @since 2010-08-08 diff --git a/src/main/java/org/jpatterns/gof/StatePattern.java b/src/main/java/org/jpatterns/gof/StatePattern.java index 882d68a..8d085bf 100644 --- a/src/main/java/org/jpatterns/gof/StatePattern.java +++ b/src/main/java/org/jpatterns/gof/StatePattern.java @@ -8,7 +8,7 @@ * Intent [GoF, pg 305]: Allow an object to alter its behavior when its * internal state changes. The object will appear to change its class. * - * State Structure + * State Structure * * @author Heinz Kabutz * @since 2010-08-09 diff --git a/src/main/java/org/jpatterns/gof/StrategyPattern.java b/src/main/java/org/jpatterns/gof/StrategyPattern.java index 3795957..c5d15f5 100644 --- a/src/main/java/org/jpatterns/gof/StrategyPattern.java +++ b/src/main/java/org/jpatterns/gof/StrategyPattern.java @@ -9,7 +9,7 @@ * one, and make them interchangeable. Strategy lets the algorithm vary * independently from clients that use it. * - * Strategy Structure + * Strategy Structure * * @author Heinz Kabutz * @since 2010-07-28 diff --git a/src/main/java/org/jpatterns/gof/TemplateMethodPattern.java b/src/main/java/org/jpatterns/gof/TemplateMethodPattern.java index a019f3d..3ebf811 100644 --- a/src/main/java/org/jpatterns/gof/TemplateMethodPattern.java +++ b/src/main/java/org/jpatterns/gof/TemplateMethodPattern.java @@ -10,7 +10,7 @@ * subclasses redefine certain steps of an algorithm without changing the * algorithm's structure. * - * Template Method Structure + * Template Method Structure * * @author Heinz Kabutz * @since 2010-07-28 diff --git a/src/main/java/org/jpatterns/gof/VisitorPattern.java b/src/main/java/org/jpatterns/gof/VisitorPattern.java index 71b5de8..4a19fb2 100644 --- a/src/main/java/org/jpatterns/gof/VisitorPattern.java +++ b/src/main/java/org/jpatterns/gof/VisitorPattern.java @@ -9,7 +9,7 @@ * elements of an object structure. Visitor lets you define a new operation * without changing the classes of the elements on which it operates. * - * Visitor Structure + * Visitor Structure * * @author Heinz Kabutz * @since 2010-08-09 diff --git a/src/main/java/org/jpatterns/jee/BusinessDelegatePattern.java b/src/main/java/org/jpatterns/jee/BusinessDelegatePattern.java index 11eb50f..3e014ee 100644 --- a/src/main/java/org/jpatterns/jee/BusinessDelegatePattern.java +++ b/src/main/java/org/jpatterns/jee/BusinessDelegatePattern.java @@ -15,7 +15,7 @@ * BusinessDelegate hides the underlying implementation details of the business * service [...]. * - * Business Delegate Structure + * Business Delegate Structure * * * @author Marco Tedone diff --git a/src/main/java/org/jpatterns/jee/DataAccessObjectPattern.java b/src/main/java/org/jpatterns/jee/DataAccessObjectPattern.java index cea3b54..3521bfd 100644 --- a/src/main/java/org/jpatterns/jee/DataAccessObjectPattern.java +++ b/src/main/java/org/jpatterns/jee/DataAccessObjectPattern.java @@ -12,7 +12,7 @@ * access to the data source. The DAO manages the connection with the data * source to obtain and store data * - * DAO Structure + * DAO Structure * * * @author Marco Tedone diff --git a/src/main/java/org/jpatterns/jee/ModelViewController.java b/src/main/java/org/jpatterns/jee/ModelViewController.java index 0fee787..7c634b0 100644 --- a/src/main/java/org/jpatterns/jee/ModelViewController.java +++ b/src/main/java/org/jpatterns/jee/ModelViewController.java @@ -16,7 +16,7 @@ * offering both services and objects to the view. * * - * MVC Structure + * MVC Structure * * * @author Marco Tedone From 49a268a7d90b6d5867523d51c6969964bf650059 Mon Sep 17 00:00:00 2001 From: "Dr Heinz M. Kabutz" Date: Tue, 11 Jun 2019 16:31:54 +0300 Subject: [PATCH 05/10] Fixed text not allowed in

      element --- src/main/java/org/jpatterns/jee/ModelViewController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jpatterns/jee/ModelViewController.java b/src/main/java/org/jpatterns/jee/ModelViewController.java index 7c634b0..8a2f178 100644 --- a/src/main/java/org/jpatterns/jee/ModelViewController.java +++ b/src/main/java/org/jpatterns/jee/ModelViewController.java @@ -7,13 +7,14 @@ /** * Intent: The Model View Controller (MVC) pattern divides an application in * three components: The View, the Controller and the Model. + * *
        *
      • The View presents data to clients
      • *
      • The Controller handles client's requests, uses the Model to get * things done and dispatches to the appropriate view a response to the request * (this response might contain objects from the Model)
      • *
      • The Model wraps the logic and the domain model of the application, - * offering both services and objects to the view
      • . + * offering both services and objects to the view *
      * * MVC Structure From 06d866965f63f514e410345dcb935bd6653f71cc Mon Sep 17 00:00:00 2001 From: "Dr Heinz M. Kabutz" Date: Tue, 11 Jun 2019 16:32:06 +0300 Subject: [PATCH 06/10] removed self-closing tag

      --- src/main/java/org/jpatterns/jee/package-info.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/org/jpatterns/jee/package-info.java b/src/main/java/org/jpatterns/jee/package-info.java index 1a78b24..c1bff29 100644 --- a/src/main/java/org/jpatterns/jee/package-info.java +++ b/src/main/java/org/jpatterns/jee/package-info.java @@ -3,8 +3,7 @@ * described in the CORE J2EE Patterns 2nd Edition - Best Practices and Design * Strategies book. * - *

      - * Although some of the EE patterns described in this book are obsolete, + * Although some of the EE patterns described in this book are obsolete, * others are still actual and defined in this package. * * @author Marco Tedone From b13ea8b6f91a8f5cb5f8768ae8cce2504035a5b5 Mon Sep 17 00:00:00 2001 From: "Dr Heinz M. Kabutz" Date: Wed, 26 Jan 2022 15:48:29 +0200 Subject: [PATCH 07/10] Removed IDEA project files --- .gitignore | 1 + jpatterns.iml | 38 - jpatterns.iws | 2144 ------------------------------------------------- 3 files changed, 1 insertion(+), 2182 deletions(-) delete mode 100644 jpatterns.iml delete mode 100644 jpatterns.iws diff --git a/.gitignore b/.gitignore index 4588240..c06cfde 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ target/ .classpath .project .settings +.idea/ \ No newline at end of file diff --git a/jpatterns.iml b/jpatterns.iml deleted file mode 100644 index 83ea572..0000000 --- a/jpatterns.iml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jpatterns.iws b/jpatterns.iws deleted file mode 100644 index 9fd9ea3..0000000 --- a/jpatterns.iws +++ /dev/null @@ -1,2144 +0,0 @@ -<<<<<<< HEAD - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Inspections - - - - - Abstraction issues - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - localhost - 5050 - - - - - - - - - - - - - - 1279137760557 - 1279137760557 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -======= - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Inspections - - - - - Abstraction issues - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - localhost - 5050 - - - - - - - - - - - - 1279137760557 - 1279137760557 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1.5 - - - - - - - - - - - - - - - - - ->>>>>>> 2fb6d980cb6611b0c2a537e94959fb56ed34d062 From 08b2fb3404dc53f77dfd3d0b5449023109ff663f Mon Sep 17 00:00:00 2001 From: "Dr Heinz M. Kabutz" Date: Wed, 26 Jan 2022 16:01:59 +0200 Subject: [PATCH 08/10] Reformatted XML file --- pom.xml | 180 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 90 insertions(+), 90 deletions(-) diff --git a/pom.xml b/pom.xml index 2855cf8..2fcfd9f 100644 --- a/pom.xml +++ b/pom.xml @@ -1,97 +1,97 @@ - - 4.0.0 + + 4.0.0 - - org.sonatype.oss - oss-parent - 7 - + + org.sonatype.oss + oss-parent + 7 + - org.jpatterns - jpatterns - 0.0.1 - jar - Java Design Pattern Annotations - - Design Patterns are typically encoded into Java code in an ad-hoc fashion. - They are either embedded into the names of the classes or written into the - Javadocs. - Unfortunately it is impossible to accurately determine a pattern based - solely on the - class structure without knowing the intent of the code author. + org.jpatterns + jpatterns + 0.0.1 + jar + Java Design Pattern Annotations + + Design Patterns are typically encoded into Java code in an ad-hoc + fashion. They are either embedded into the names of the classes or + written into the Javadocs. Unfortunately it is impossible to accurately + determine a pattern based solely on the class structure without knowing + the intent of the code author. - JPatterns is a collection of annotations that make it easy to communicate - the use - of (Design)Patterns within your code to your fellow developers and your - future self. - - http://jpatterns.org - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - http://github.com/jexp/jpatterns - git://github.com/jexp/jpatterns.git - git@github.com:jexp/jpatterns.git - + JPatterns is a collection of annotations that make it easy to + communicate the use of (Design)Patterns within your code to your fellow + developers and your future self. + + http://jpatterns.org + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + http://github.com/jexp/jpatterns + git://github.com/jexp/jpatterns.git + git@github.com:jexp/jpatterns.git + + - - - - org.apache.maven.plugins - maven-compiler-plugin - 2.3.2 - - 6 - 6 - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.7 - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - - - attach-sources - - jar - - - - - - + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.3.2 + + 6 + 6 + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.7 + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + + + - - - junit - junit-dep - 4.13.2 - test - - - org.easymock - easymock - 2.4 - test - - + + + junit + junit-dep + 4.13.2 + test + + + org.easymock + easymock + 2.4 + test + + \ No newline at end of file From 320e27873e911324361e0f250cee16e3b3e885ed Mon Sep 17 00:00:00 2001 From: "Dr Heinz M. Kabutz" Date: Wed, 26 Jan 2022 16:06:31 +0200 Subject: [PATCH 09/10] Updated junit artifactId --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2fcfd9f..137f3b5 100644 --- a/pom.xml +++ b/pom.xml @@ -83,7 +83,7 @@ junit - junit-dep + junit 4.13.2 test From 7b41519ba2e2487e753c4ef3dd807fdbec2ea5cb Mon Sep 17 00:00:00 2001 From: "Dr Heinz M. Kabutz" Date: Wed, 26 Jan 2022 16:21:14 +0200 Subject: [PATCH 10/10] Reformatting, got rid of import.*, changed version back to 0.1, java version 8, added

      --- pom.xml | 6 +- .../org/jpatterns/core/DesignPattern.java | 17 ++- .../java/org/jpatterns/core/Refactoring.java | 2 +- src/main/java/org/jpatterns/core/Source.java | 2 +- src/main/java/org/jpatterns/core/Type.java | 2 +- .../org/jpatterns/doc/PatternComment.java | 23 ++-- .../jpatterns/doc/PatternParticipants.java | 23 ++-- .../jpatterns/gof/AbstractFactoryPattern.java | 91 +++++++------- .../org/jpatterns/gof/AdapterPattern.java | 71 +++++------ .../java/org/jpatterns/gof/BridgePattern.java | 73 +++++------ .../org/jpatterns/gof/BuilderPattern.java | 71 ++++++----- .../gof/ChainOfResponsibilityPattern.java | 47 ++++---- .../org/jpatterns/gof/CommandPattern.java | 105 ++++++++-------- .../org/jpatterns/gof/CompositePattern.java | 61 +++++----- .../org/jpatterns/gof/DecoratorPattern.java | 75 ++++++------ .../java/org/jpatterns/gof/FacadePattern.java | 19 +-- .../jpatterns/gof/FactoryMethodPattern.java | 77 ++++++------ .../org/jpatterns/gof/FlyweightPattern.java | 75 ++++++------ .../org/jpatterns/gof/InterpreterPattern.java | 73 +++++------ .../org/jpatterns/gof/IteratorPattern.java | 75 ++++++------ .../org/jpatterns/gof/MediatorPattern.java | 73 +++++------ .../org/jpatterns/gof/MementoPattern.java | 73 +++++------ .../org/jpatterns/gof/ObserverPattern.java | 73 +++++------ .../org/jpatterns/gof/PrototypePattern.java | 59 ++++----- .../java/org/jpatterns/gof/ProxyPattern.java | 95 ++++++++------- .../org/jpatterns/gof/SingletonPattern.java | 55 +++++---- .../java/org/jpatterns/gof/StatePattern.java | 59 ++++----- .../org/jpatterns/gof/StrategyPattern.java | 73 +++++------ .../jpatterns/gof/TemplateMethodPattern.java | 95 ++++++++------- .../org/jpatterns/gof/VisitorPattern.java | 87 +++++++------- .../jee/BusinessDelegatePattern.java | 55 +++++---- .../jee/DataAccessObjectPattern.java | 113 +++++++++--------- .../jpatterns/jee/ModelViewController.java | 63 +++++----- .../java/org/jpatterns/jee/package-info.java | 6 +- .../jpatterns/plopd/NullObjectPattern.java | 86 +++++++------ 35 files changed, 1103 insertions(+), 950 deletions(-) diff --git a/pom.xml b/pom.xml index 137f3b5..7a047e6 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.jpatterns jpatterns - 0.0.1 + 0.1 jar Java Design Pattern Annotations @@ -48,8 +48,8 @@ maven-compiler-plugin 2.3.2 - 6 - 6 + 8 + 8 diff --git a/src/main/java/org/jpatterns/core/DesignPattern.java b/src/main/java/org/jpatterns/core/DesignPattern.java index c0b862e..e3c71b3 100644 --- a/src/main/java/org/jpatterns/core/DesignPattern.java +++ b/src/main/java/org/jpatterns/core/DesignPattern.java @@ -1,6 +1,11 @@ package org.jpatterns.core; -import java.lang.annotation.*; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; /** * @author Michael Hunger @@ -11,13 +16,13 @@ @Documented @Inherited public @interface DesignPattern { - Source source() default Source.GoF; + Source source() default Source.GoF; - Type type(); + Type type(); - String[] urls() default {}; + String[] urls() default {}; - Refactoring[] refactorings() default {}; + Refactoring[] refactorings() default {}; - Class[] related() default {}; + Class[] related() default {}; } diff --git a/src/main/java/org/jpatterns/core/Refactoring.java b/src/main/java/org/jpatterns/core/Refactoring.java index ea949b6..fde0a22 100644 --- a/src/main/java/org/jpatterns/core/Refactoring.java +++ b/src/main/java/org/jpatterns/core/Refactoring.java @@ -5,5 +5,5 @@ * @since 2010-08-08 */ public enum Refactoring { - ExtractMethodObject, ExtractParameterObject + ExtractMethodObject, ExtractParameterObject } diff --git a/src/main/java/org/jpatterns/core/Source.java b/src/main/java/org/jpatterns/core/Source.java index 17e366c..5c282ca 100644 --- a/src/main/java/org/jpatterns/core/Source.java +++ b/src/main/java/org/jpatterns/core/Source.java @@ -5,5 +5,5 @@ * @since 2010-07-14 */ public enum Source { - GoF, POSA, PoEAA, PLoPD3, CoreJ2EE, Other, Hophe + GoF, POSA, PoEAA, PLoPD3, CoreJ2EE, Other, Hophe } diff --git a/src/main/java/org/jpatterns/core/Type.java b/src/main/java/org/jpatterns/core/Type.java index 0dfafbb..fc85faa 100644 --- a/src/main/java/org/jpatterns/core/Type.java +++ b/src/main/java/org/jpatterns/core/Type.java @@ -5,5 +5,5 @@ * @since 2010-07-14 */ public enum Type { - CREATIONAL, STRUCTURAL, BEHAVIORAL, USER_INTERFACE, MESSAGING, ENTERPRISE + CREATIONAL, STRUCTURAL, BEHAVIORAL, USER_INTERFACE, MESSAGING, ENTERPRISE } \ No newline at end of file diff --git a/src/main/java/org/jpatterns/doc/PatternComment.java b/src/main/java/org/jpatterns/doc/PatternComment.java index 0937399..9941a3f 100644 --- a/src/main/java/org/jpatterns/doc/PatternComment.java +++ b/src/main/java/org/jpatterns/doc/PatternComment.java @@ -1,6 +1,11 @@ package org.jpatterns.doc; -import java.lang.annotation.*; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; /** * @author Heinz Kabutz @@ -9,16 +14,16 @@ */ @Retention(RetentionPolicy.RUNTIME) @Target({ - ElementType.TYPE, - ElementType.CONSTRUCTOR, - ElementType.FIELD, - ElementType.LOCAL_VARIABLE, - ElementType.METHOD, - ElementType.PARAMETER - }) + ElementType.TYPE, + ElementType.CONSTRUCTOR, + ElementType.FIELD, + ElementType.LOCAL_VARIABLE, + ElementType.METHOD, + ElementType.PARAMETER +}) @Documented @Inherited @Deprecated public @interface PatternComment { - String value(); + String value(); } diff --git a/src/main/java/org/jpatterns/doc/PatternParticipants.java b/src/main/java/org/jpatterns/doc/PatternParticipants.java index f9287e1..fc24711 100644 --- a/src/main/java/org/jpatterns/doc/PatternParticipants.java +++ b/src/main/java/org/jpatterns/doc/PatternParticipants.java @@ -1,6 +1,11 @@ package org.jpatterns.doc; -import java.lang.annotation.*; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; /** * @author Heinz Kabutz @@ -9,16 +14,16 @@ */ @Retention(RetentionPolicy.RUNTIME) @Target({ - ElementType.TYPE, - ElementType.CONSTRUCTOR, - ElementType.FIELD, - ElementType.LOCAL_VARIABLE, - ElementType.METHOD, - ElementType.PARAMETER - }) + ElementType.TYPE, + ElementType.CONSTRUCTOR, + ElementType.FIELD, + ElementType.LOCAL_VARIABLE, + ElementType.METHOD, + ElementType.PARAMETER +}) @Documented @Inherited @Deprecated public @interface PatternParticipants { - Class[] value(); + Class[] value(); } diff --git a/src/main/java/org/jpatterns/gof/AbstractFactoryPattern.java b/src/main/java/org/jpatterns/gof/AbstractFactoryPattern.java index 089093a..d130008 100644 --- a/src/main/java/org/jpatterns/gof/AbstractFactoryPattern.java +++ b/src/main/java/org/jpatterns/gof/AbstractFactoryPattern.java @@ -1,15 +1,20 @@ package org.jpatterns.gof; -import org.jpatterns.core.*; +import org.jpatterns.core.DesignPattern; +import org.jpatterns.core.Type; -import java.lang.annotation.*; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; /** * Intent [GoF, pg 87]: Provide an interface for creating families of * related or dependent objects without specifying their concrete classes. - *

      + *

      * Abstract Factory Structure - *

      + *

      * Abstract Factory User View Structure * * @author Heinz Kabutz, Michael Hunger @@ -19,55 +24,55 @@ @Target(ElementType.TYPE) @Documented @DesignPattern(type = Type.CREATIONAL, - related = {FactoryMethodPattern.class, PrototypePattern.class, - SingletonPattern.class}) + related = {FactoryMethodPattern.class, PrototypePattern.class, + SingletonPattern.class}) public @interface AbstractFactoryPattern { - Class[] participants() default {}; - - String comment() default ""; - - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface AbstractProduct { Class[] participants() default {}; String comment() default ""; - } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface ConcreteProduct { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface AbstractProduct { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.METHOD) - @Documented - public @interface FactoryMethod { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface ConcreteProduct { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface AbstractFactory { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.METHOD) + @Documented + public @interface FactoryMethod { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface ConcreteFactory { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface AbstractFactory { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } + + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface ConcreteFactory { + Class[] participants() default {}; + + String comment() default ""; + } } diff --git a/src/main/java/org/jpatterns/gof/AdapterPattern.java b/src/main/java/org/jpatterns/gof/AdapterPattern.java index b892238..c0edb57 100644 --- a/src/main/java/org/jpatterns/gof/AdapterPattern.java +++ b/src/main/java/org/jpatterns/gof/AdapterPattern.java @@ -1,20 +1,23 @@ package org.jpatterns.gof; -import org.jpatterns.core.*; +import org.jpatterns.core.DesignPattern; +import org.jpatterns.core.Type; -import java.lang.annotation.*; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; /** * Intent [GoF, pg 139]: Convert the interface of a class into another * interface clients expect. Adapter lets classes work together that couldn't * otherwise because of incompatible interfaces. - *

      + *

      * The structure for an object adapter is: - *

      * Object Adapter Structure - *

      + *

      * The structure for a class adapter is: - *

      * Class Adapter Structure * * @author Heinz Kabutz @@ -24,42 +27,42 @@ @Target(ElementType.TYPE) @Documented @DesignPattern(type = Type.STRUCTURAL, - related = {BridgePattern.class, DecoratorPattern.class, ProxyPattern.class}) + related = {BridgePattern.class, DecoratorPattern.class, ProxyPattern.class}) public @interface AdapterPattern { - Class[] participants() default {}; - - String comment() default ""; - - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Adapter { Class[] participants() default {}; String comment() default ""; - Variation value() default Variation.OBJECT; - } + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Adapter { + Class[] participants() default {}; - /** - * We would hardly ever use this annotation as the adaptee is - * usually not aware that he is being adapted. - */ - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Adaptee { - Class[] participants() default {}; + String comment() default ""; - String comment() default ""; - } + Variation value() default Variation.OBJECT; + } - public enum Variation { - OBJECT, - CLASS, /** - * See http://www.javaspecialists.eu/archive/Issue108.html + * We would hardly ever use this annotation as the adaptee is + * usually not aware that he is being adapted. */ - DYNAMIC - } + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Adaptee { + Class[] participants() default {}; + + String comment() default ""; + } + + public enum Variation { + OBJECT, + CLASS, + /** + * See http://www.javaspecialists.eu/archive/Issue108.html + */ + DYNAMIC + } } diff --git a/src/main/java/org/jpatterns/gof/BridgePattern.java b/src/main/java/org/jpatterns/gof/BridgePattern.java index b3d7ab9..5597888 100644 --- a/src/main/java/org/jpatterns/gof/BridgePattern.java +++ b/src/main/java/org/jpatterns/gof/BridgePattern.java @@ -1,13 +1,18 @@ package org.jpatterns.gof; -import org.jpatterns.core.*; +import org.jpatterns.core.DesignPattern; +import org.jpatterns.core.Type; -import java.lang.annotation.*; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; /** * Intent [GoF, pg 151]: Decouple an abstraction from its implementation * so that the two can vary independently. - *

      + *

      * Bridge Structure * * @author Heinz Kabutz @@ -17,45 +22,45 @@ @Target(ElementType.TYPE) @Documented @DesignPattern(type = Type.STRUCTURAL, - related = {AbstractFactoryPattern.class, AdapterPattern.class}) + related = {AbstractFactoryPattern.class, AdapterPattern.class}) public @interface BridgePattern { - Class[] participants() default {}; - - String comment() default ""; - - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Abstraction { Class[] participants() default {}; String comment() default ""; - } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface RefinedAbstraction { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Abstraction { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Implementor { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface RefinedAbstraction { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface ConcreteImplementor { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Implementor { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } + + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface ConcreteImplementor { + Class[] participants() default {}; + + String comment() default ""; + } } diff --git a/src/main/java/org/jpatterns/gof/BuilderPattern.java b/src/main/java/org/jpatterns/gof/BuilderPattern.java index 2e3ada2..02c40f0 100644 --- a/src/main/java/org/jpatterns/gof/BuilderPattern.java +++ b/src/main/java/org/jpatterns/gof/BuilderPattern.java @@ -1,8 +1,13 @@ package org.jpatterns.gof; -import org.jpatterns.core.*; +import org.jpatterns.core.DesignPattern; +import org.jpatterns.core.Type; -import java.lang.annotation.*; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; /** * Intent [GoF, pg 97]: Separate the construction of a complex object @@ -16,46 +21,46 @@ @Target(ElementType.TYPE) @Documented @DesignPattern(type = Type.CREATIONAL, - related = {AbstractFactoryPattern.class, CompositePattern.class}) + related = {AbstractFactoryPattern.class, CompositePattern.class}) public @interface BuilderPattern { - Class[] participants() default {}; - - String comment() default ""; - - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Director { Class[] participants() default {}; String comment() default ""; - } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Builder { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Director { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface ConcreteBuilder { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Builder { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Product { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface ConcreteBuilder { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } + + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Product { + Class[] participants() default {}; + + String comment() default ""; + } } diff --git a/src/main/java/org/jpatterns/gof/ChainOfResponsibilityPattern.java b/src/main/java/org/jpatterns/gof/ChainOfResponsibilityPattern.java index cbcf682..ceac72f 100644 --- a/src/main/java/org/jpatterns/gof/ChainOfResponsibilityPattern.java +++ b/src/main/java/org/jpatterns/gof/ChainOfResponsibilityPattern.java @@ -1,15 +1,20 @@ package org.jpatterns.gof; -import org.jpatterns.core.*; +import org.jpatterns.core.DesignPattern; +import org.jpatterns.core.Type; -import java.lang.annotation.*; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; /** * Intent [GoF, pg 223]: Avoid coupling the sender of a request to its * receiver by giving more than one object a chance to handle the request. Chain * the receiving objects and pass the request along the chain until an object * handles it. - *

      + *

      * Chain Of Responsibility Structure * * @author Heinz Kabutz @@ -19,29 +24,29 @@ @Target(ElementType.TYPE) @Documented @DesignPattern(type = Type.BEHAVIORAL, - related = {CompositePattern.class}) + related = {CompositePattern.class}) public @interface ChainOfResponsibilityPattern { - Class[] participants() default {}; - - String comment() default ""; - - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Handler { Class[] participants() default {}; String comment() default ""; - } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface ConcreteHandler { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Handler { + Class[] participants() default {}; - String comment() default ""; + String comment() default ""; + } + + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface ConcreteHandler { + Class[] participants() default {}; + + String comment() default ""; - boolean defaultHandler() default false; - } + boolean defaultHandler() default false; + } } diff --git a/src/main/java/org/jpatterns/gof/CommandPattern.java b/src/main/java/org/jpatterns/gof/CommandPattern.java index cc2ce37..1dce962 100644 --- a/src/main/java/org/jpatterns/gof/CommandPattern.java +++ b/src/main/java/org/jpatterns/gof/CommandPattern.java @@ -1,14 +1,21 @@ package org.jpatterns.gof; -import org.jpatterns.core.*; +import org.jpatterns.core.DesignPattern; +import org.jpatterns.core.Refactoring; +import org.jpatterns.core.Source; +import org.jpatterns.core.Type; -import java.lang.annotation.*; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; /** * Intent [GoF, pg 233]: Encapsulate a request as an object, thereby * letting you parameterize clients with different requests, queue or log * requests, and support undoable operations. - *

      + *

      * Command Structure * * @author Michael Hunger @@ -18,64 +25,64 @@ @Target(ElementType.TYPE) @Documented @DesignPattern(source = Source.GoF, - type = Type.BEHAVIORAL, - urls = {"http://en.wikipedia.org/wiki/Command_pattern", - "http://home.earthlink.net/~huston2/dp/command.html"}, - refactorings = { - Refactoring.ExtractParameterObject, - Refactoring.ExtractMethodObject}, - related = {CompositePattern.class, MementoPattern.class, - PrototypePattern.class}) + type = Type.BEHAVIORAL, + urls = {"http://en.wikipedia.org/wiki/Command_pattern", + "http://home.earthlink.net/~huston2/dp/command.html"}, + refactorings = { + Refactoring.ExtractParameterObject, + Refactoring.ExtractMethodObject}, + related = {CompositePattern.class, MementoPattern.class, + PrototypePattern.class}) public @interface CommandPattern { - Class[] participants() default {}; - - String comment() default ""; - - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Command { Class[] participants() default {}; String comment() default ""; - boolean undoable() default false; - } + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Command { + Class[] participants() default {}; - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface ConcreteCommand { - Class[] participants() default {}; + String comment() default ""; - String comment() default ""; - } + boolean undoable() default false; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Invoker { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface ConcreteCommand { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Receiver { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Invoker { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Client { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Receiver { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } + + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Client { + Class[] participants() default {}; + + String comment() default ""; + } } diff --git a/src/main/java/org/jpatterns/gof/CompositePattern.java b/src/main/java/org/jpatterns/gof/CompositePattern.java index 30ab2fd..2af0c58 100644 --- a/src/main/java/org/jpatterns/gof/CompositePattern.java +++ b/src/main/java/org/jpatterns/gof/CompositePattern.java @@ -1,14 +1,19 @@ package org.jpatterns.gof; -import org.jpatterns.core.*; +import org.jpatterns.core.DesignPattern; +import org.jpatterns.core.Type; -import java.lang.annotation.*; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; /** * Intent [GoF, pg 163]: Compose objects into tree structures to * represent whole-part hierarchies. Composite lets clients treat individual * objects and compositions of objects uniformly. - *

      + *

      * Composite Structure * * @author Heinz Kabutz @@ -18,37 +23,37 @@ @Target(ElementType.TYPE) @Documented @DesignPattern(type = Type.STRUCTURAL, - related = {ChainOfResponsibilityPattern.class, DecoratorPattern.class, - FlyweightPattern.class, IteratorPattern.class, VisitorPattern.class}) + related = {ChainOfResponsibilityPattern.class, DecoratorPattern.class, + FlyweightPattern.class, IteratorPattern.class, VisitorPattern.class}) public @interface CompositePattern { - Class[] participants() default {}; - - String comment() default ""; - - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Component { Class[] participants() default {}; String comment() default ""; - } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Leaf { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Component { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Composite { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Leaf { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } + + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Composite { + Class[] participants() default {}; + + String comment() default ""; + } } diff --git a/src/main/java/org/jpatterns/gof/DecoratorPattern.java b/src/main/java/org/jpatterns/gof/DecoratorPattern.java index 5957a30..419ac4c 100644 --- a/src/main/java/org/jpatterns/gof/DecoratorPattern.java +++ b/src/main/java/org/jpatterns/gof/DecoratorPattern.java @@ -1,14 +1,19 @@ package org.jpatterns.gof; -import org.jpatterns.core.*; +import org.jpatterns.core.DesignPattern; +import org.jpatterns.core.Type; -import java.lang.annotation.*; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; /** * Intent [GoF, pg 175]: Attach additional responsibilities to an object * dynamically. Decorators provide a flexible alternative to subclassing for * extending functionality. - *

      + *

      * Decorator Structure * * @author Heinz Kabutz @@ -18,46 +23,46 @@ @Target(ElementType.TYPE) @Documented @DesignPattern(type = Type.STRUCTURAL, - related = {AdapterPattern.class, CompositePattern.class, - StrategyPattern.class}) + related = {AdapterPattern.class, CompositePattern.class, + StrategyPattern.class}) public @interface DecoratorPattern { - Class[] participants() default {}; - - String comment() default ""; - - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Component { Class[] participants() default {}; String comment() default ""; - } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Decorator { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Component { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface ConcreteComponent { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Decorator { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface ConcreteDecorator { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface ConcreteComponent { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } + + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface ConcreteDecorator { + Class[] participants() default {}; + + String comment() default ""; + } } diff --git a/src/main/java/org/jpatterns/gof/FacadePattern.java b/src/main/java/org/jpatterns/gof/FacadePattern.java index dfd7863..94d70cf 100644 --- a/src/main/java/org/jpatterns/gof/FacadePattern.java +++ b/src/main/java/org/jpatterns/gof/FacadePattern.java @@ -1,14 +1,19 @@ package org.jpatterns.gof; -import org.jpatterns.core.*; +import org.jpatterns.core.DesignPattern; +import org.jpatterns.core.Type; -import java.lang.annotation.*; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; /** * Intent [GoF, pg 185]: Provide a unified interface to a set of * interfaces in a subsystem. Facade defines a higher-level interface that makes * the subsystem easier to use. - *

      + *

      * Facade Structure * * @author Heinz Kabutz @@ -18,10 +23,10 @@ @Target(ElementType.TYPE) @Documented @DesignPattern(type = Type.STRUCTURAL, - related = {AbstractFactoryPattern.class, MediatorPattern.class, - SingletonPattern.class}) + related = {AbstractFactoryPattern.class, MediatorPattern.class, + SingletonPattern.class}) public @interface FacadePattern { - Class[] participants() default {}; + Class[] participants() default {}; - String comment() default ""; + String comment() default ""; } diff --git a/src/main/java/org/jpatterns/gof/FactoryMethodPattern.java b/src/main/java/org/jpatterns/gof/FactoryMethodPattern.java index c04e27b..7ffcf97 100644 --- a/src/main/java/org/jpatterns/gof/FactoryMethodPattern.java +++ b/src/main/java/org/jpatterns/gof/FactoryMethodPattern.java @@ -1,17 +1,22 @@ package org.jpatterns.gof; -import org.jpatterns.core.*; +import org.jpatterns.core.DesignPattern; +import org.jpatterns.core.Type; -import java.lang.annotation.*; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; /** * Intent [GoF, pg 107]: Define an interface for creating an object, but * let subclasses decide which class to instantiate. Factory Method lets a class * defer instantiation to subclasses. - *

      + *

      * This pattern refers to the GoF factory method, which differs greatly from the * static factory method commonly found in the refactoring literature. - *

      + *

      * Factory Method Structure * * @author Heinz Kabutz @@ -21,46 +26,46 @@ @Target(ElementType.TYPE) @Documented @DesignPattern(type = Type.CREATIONAL, - related = {AbstractFactoryPattern.class, TemplateMethodPattern.class, - PrototypePattern.class}) + related = {AbstractFactoryPattern.class, TemplateMethodPattern.class, + PrototypePattern.class}) public @interface FactoryMethodPattern { - Class[] participants() default {}; - - String comment() default ""; - - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Creator { Class[] participants() default {}; String comment() default ""; - } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Product { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Creator { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface ConcreteCreator { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Product { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface ConcreteProduct { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface ConcreteCreator { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } + + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface ConcreteProduct { + Class[] participants() default {}; + + String comment() default ""; + } } diff --git a/src/main/java/org/jpatterns/gof/FlyweightPattern.java b/src/main/java/org/jpatterns/gof/FlyweightPattern.java index 3148cd6..75c00be 100644 --- a/src/main/java/org/jpatterns/gof/FlyweightPattern.java +++ b/src/main/java/org/jpatterns/gof/FlyweightPattern.java @@ -1,13 +1,18 @@ package org.jpatterns.gof; -import org.jpatterns.core.*; +import org.jpatterns.core.DesignPattern; +import org.jpatterns.core.Type; -import java.lang.annotation.*; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; /** * Intent [GoF, pg 195]: Use sharing to support large numbers of * fine-grained objects efficiently. - *

      + *

      * Flyweight Structure * * @author Heinz Kabutz @@ -17,46 +22,46 @@ @Target(ElementType.TYPE) @Documented @DesignPattern(type = Type.STRUCTURAL, - related = {CompositePattern.class, StatePattern.class, - StrategyPattern.class}) + related = {CompositePattern.class, StatePattern.class, + StrategyPattern.class}) public @interface FlyweightPattern { - Class[] participants() default {}; - - String comment() default ""; - - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface FlyweightFactory { Class[] participants() default {}; String comment() default ""; - } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Flyweight { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface FlyweightFactory { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface UnsharedConcreteFlyweight { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Flyweight { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface ConcreteFlyweight { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface UnsharedConcreteFlyweight { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } + + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface ConcreteFlyweight { + Class[] participants() default {}; + + String comment() default ""; + } } diff --git a/src/main/java/org/jpatterns/gof/InterpreterPattern.java b/src/main/java/org/jpatterns/gof/InterpreterPattern.java index edffcff..bdc73ab 100644 --- a/src/main/java/org/jpatterns/gof/InterpreterPattern.java +++ b/src/main/java/org/jpatterns/gof/InterpreterPattern.java @@ -1,8 +1,13 @@ package org.jpatterns.gof; -import org.jpatterns.core.*; +import org.jpatterns.core.DesignPattern; +import org.jpatterns.core.Type; -import java.lang.annotation.*; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; /** * Intent [GoF, pg 243]: Given a language, define a represention for its @@ -16,46 +21,46 @@ @Target(ElementType.TYPE) @Documented @DesignPattern(type = Type.BEHAVIORAL, - related = {CompositePattern.class, FlyweightPattern.class, - IteratorPattern.class, VisitorPattern.class}) + related = {CompositePattern.class, FlyweightPattern.class, + IteratorPattern.class, VisitorPattern.class}) public @interface InterpreterPattern { - Class[] participants() default {}; - - String comment() default ""; - - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Context { Class[] participants() default {}; String comment() default ""; - } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface AbstractExpression { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Context { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface TerminalExpression { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface AbstractExpression { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface NonterminalExpression { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface TerminalExpression { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } + + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface NonterminalExpression { + Class[] participants() default {}; + + String comment() default ""; + } } diff --git a/src/main/java/org/jpatterns/gof/IteratorPattern.java b/src/main/java/org/jpatterns/gof/IteratorPattern.java index dd96cb8..7966b39 100644 --- a/src/main/java/org/jpatterns/gof/IteratorPattern.java +++ b/src/main/java/org/jpatterns/gof/IteratorPattern.java @@ -1,13 +1,18 @@ package org.jpatterns.gof; -import org.jpatterns.core.*; +import org.jpatterns.core.DesignPattern; +import org.jpatterns.core.Type; -import java.lang.annotation.*; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; /** * Intent [GoF, pg 257]: Provide a way to access the elements of an * aggregate object sequentially without exposing its underlying representation. - *

      + *

      * Iterator Structure * * @author Heinz Kabutz @@ -17,46 +22,46 @@ @Target(ElementType.TYPE) @Documented @DesignPattern(type = Type.BEHAVIORAL, - related = {CompositePattern.class, FactoryMethodPattern.class, - MementoPattern.class}) + related = {CompositePattern.class, FactoryMethodPattern.class, + MementoPattern.class}) public @interface IteratorPattern { - Class[] participants() default {}; - - String comment() default ""; - - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Aggregate { Class[] participants() default {}; String comment() default ""; - } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Iterator { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Aggregate { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface ConcreteAggregate { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Iterator { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface ConcreteIterator { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface ConcreteAggregate { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } + + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface ConcreteIterator { + Class[] participants() default {}; + + String comment() default ""; + } } diff --git a/src/main/java/org/jpatterns/gof/MediatorPattern.java b/src/main/java/org/jpatterns/gof/MediatorPattern.java index 37eef94..6e00ac1 100644 --- a/src/main/java/org/jpatterns/gof/MediatorPattern.java +++ b/src/main/java/org/jpatterns/gof/MediatorPattern.java @@ -1,15 +1,20 @@ package org.jpatterns.gof; -import org.jpatterns.core.*; +import org.jpatterns.core.DesignPattern; +import org.jpatterns.core.Type; -import java.lang.annotation.*; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; /** * Intent [GoF, pg 273]: Define an object that encapsulates how a set of * objects interact. Mediator promotes loose coupling by keeping objects from * referring to each other explicitly, and it lets you vary their interaction * independently. - *

      + *

      * Mediator Structure * * @author Heinz Kabutz @@ -19,45 +24,45 @@ @Target(ElementType.TYPE) @Documented @DesignPattern(type = Type.BEHAVIORAL, - related = {FacadePattern.class, ObserverPattern.class}) + related = {FacadePattern.class, ObserverPattern.class}) public @interface MediatorPattern { - Class[] participants() default {}; - - String comment() default ""; - - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Mediator { Class[] participants() default {}; String comment() default ""; - } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Colleague { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Mediator { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface ConcreteMediator { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Colleague { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface ConcreteColleague { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface ConcreteMediator { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } + + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface ConcreteColleague { + Class[] participants() default {}; + + String comment() default ""; + } } diff --git a/src/main/java/org/jpatterns/gof/MementoPattern.java b/src/main/java/org/jpatterns/gof/MementoPattern.java index 343de15..f0607fa 100644 --- a/src/main/java/org/jpatterns/gof/MementoPattern.java +++ b/src/main/java/org/jpatterns/gof/MementoPattern.java @@ -1,14 +1,19 @@ package org.jpatterns.gof; -import org.jpatterns.core.*; +import org.jpatterns.core.DesignPattern; +import org.jpatterns.core.Type; -import java.lang.annotation.*; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; /** * Intent [GoF, pg 283]: Without violating encapsulation, capture and * externalize an object's internal state so that the object can be restored to * this state later. - * + *

      * Memento Structure * * @author Heinz Kabutz @@ -18,45 +23,45 @@ @Target(ElementType.TYPE) @Documented @DesignPattern(type = Type.BEHAVIORAL, - related = {FacadePattern.class, ObserverPattern.class}) + related = {FacadePattern.class, ObserverPattern.class}) public @interface MementoPattern { - Class[] participants() default {}; - - String comment() default ""; - - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Originator { Class[] participants() default {}; String comment() default ""; - } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Memento { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Originator { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface MementoImpl { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Memento { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Caretaker { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface MementoImpl { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } + + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Caretaker { + Class[] participants() default {}; + + String comment() default ""; + } } diff --git a/src/main/java/org/jpatterns/gof/ObserverPattern.java b/src/main/java/org/jpatterns/gof/ObserverPattern.java index f118344..26ce654 100644 --- a/src/main/java/org/jpatterns/gof/ObserverPattern.java +++ b/src/main/java/org/jpatterns/gof/ObserverPattern.java @@ -1,14 +1,19 @@ package org.jpatterns.gof; -import org.jpatterns.core.*; +import org.jpatterns.core.DesignPattern; +import org.jpatterns.core.Type; -import java.lang.annotation.*; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; /** * Intent [GoF, pg 293]: Define a one-to-many dependency between objects * so that when one object changes state, all its dependents are notified and * updated automatically. - *

      + *

      * Observer Structure * * @author Heinz Kabutz @@ -18,45 +23,45 @@ @Target(ElementType.TYPE) @Documented @DesignPattern(type = Type.BEHAVIORAL, - related = {MediatorPattern.class, SingletonPattern.class}) + related = {MediatorPattern.class, SingletonPattern.class}) public @interface ObserverPattern { - Class[] participants() default {}; - - String comment() default ""; - - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Observer { Class[] participants() default {}; String comment() default ""; - } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Subject { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Observer { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface ConcreteObserver { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Subject { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface ConcreteSubject { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface ConcreteObserver { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } + + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface ConcreteSubject { + Class[] participants() default {}; + + String comment() default ""; + } } diff --git a/src/main/java/org/jpatterns/gof/PrototypePattern.java b/src/main/java/org/jpatterns/gof/PrototypePattern.java index 42be9ed..1142da5 100644 --- a/src/main/java/org/jpatterns/gof/PrototypePattern.java +++ b/src/main/java/org/jpatterns/gof/PrototypePattern.java @@ -1,8 +1,13 @@ package org.jpatterns.gof; -import org.jpatterns.core.*; +import org.jpatterns.core.DesignPattern; +import org.jpatterns.core.Type; -import java.lang.annotation.*; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; /** * Intent [GoF, pg 117]: Specify the kinds of objects to create using a @@ -15,37 +20,37 @@ @Target(ElementType.TYPE) @Documented @DesignPattern(type = Type.CREATIONAL, - related = {AbstractFactoryPattern.class, CompositePattern.class, - DecoratorPattern.class}) + related = {AbstractFactoryPattern.class, CompositePattern.class, + DecoratorPattern.class}) public @interface PrototypePattern { - Class[] participants() default {}; - - String comment() default ""; - - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Prototype { Class[] participants() default {}; String comment() default ""; - } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface ConcretePrototype { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Prototype { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.METHOD) - @Documented - public @interface Operation { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface ConcretePrototype { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } + + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.METHOD) + @Documented + public @interface Operation { + Class[] participants() default {}; + + String comment() default ""; + } } diff --git a/src/main/java/org/jpatterns/gof/ProxyPattern.java b/src/main/java/org/jpatterns/gof/ProxyPattern.java index fc81cee..b2e395c 100644 --- a/src/main/java/org/jpatterns/gof/ProxyPattern.java +++ b/src/main/java/org/jpatterns/gof/ProxyPattern.java @@ -1,13 +1,18 @@ package org.jpatterns.gof; -import org.jpatterns.core.*; +import org.jpatterns.core.DesignPattern; +import org.jpatterns.core.Type; -import java.lang.annotation.*; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; /** * Intent [GoF, pg 207]: Provide a surrogate or placeholder for another * object to control access to it. - *

      + *

      * Proxy Structure * * @author Heinz Kabutz @@ -15,63 +20,63 @@ */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE, ElementType.FIELD, - ElementType.LOCAL_VARIABLE}) + ElementType.LOCAL_VARIABLE}) @Documented @DesignPattern(type = Type.STRUCTURAL, - related = {AdapterPattern.class, DecoratorPattern.class}) + related = {AdapterPattern.class, DecoratorPattern.class}) public @interface ProxyPattern { - Class[] participants() default {}; + Class[] participants() default {}; - String comment() default ""; + String comment() default ""; - Variation variation() default Variation.STATIC_MANUAL; + Variation variation() default Variation.STATIC_MANUAL; - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Subject { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Subject { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface RealSubject { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface RealSubject { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Proxy { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Proxy { + Class[] participants() default {}; - String comment() default ""; + String comment() default ""; - Variation variation() default Variation.STATIC_MANUAL; + Variation variation() default Variation.STATIC_MANUAL; - Type type() default Type.UNDEFINED; - } + Type type() default Type.UNDEFINED; + } - @Retention(RetentionPolicy.RUNTIME) - @Target({ElementType.TYPE, ElementType.FIELD, - ElementType.LOCAL_VARIABLE}) - @Documented - public @interface Client { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target({ElementType.TYPE, ElementType.FIELD, + ElementType.LOCAL_VARIABLE}) + @Documented + public @interface Client { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } - public static enum Variation { - STATIC_MANUAL, STATIC_GENERATED, DYNAMIC - } + public static enum Variation { + STATIC_MANUAL, STATIC_GENERATED, DYNAMIC + } - public static enum Type { - UNDEFINED, VIRTUAL, REMOTE, PROTECTION - } + public static enum Type { + UNDEFINED, VIRTUAL, REMOTE, PROTECTION + } } diff --git a/src/main/java/org/jpatterns/gof/SingletonPattern.java b/src/main/java/org/jpatterns/gof/SingletonPattern.java index a557bd0..7b3b8f4 100644 --- a/src/main/java/org/jpatterns/gof/SingletonPattern.java +++ b/src/main/java/org/jpatterns/gof/SingletonPattern.java @@ -1,13 +1,18 @@ package org.jpatterns.gof; -import org.jpatterns.core.*; +import org.jpatterns.core.DesignPattern; +import org.jpatterns.core.Type; -import java.lang.annotation.*; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; /** * Intent [GoF, pg 127]: Ensure a class only has one instance, and * provide a global point of access to it. - *

      + *

      * Singleton Structure * * @author Alex Gout @@ -17,34 +22,34 @@ @Target(ElementType.TYPE) @Documented @DesignPattern(type = Type.CREATIONAL, - related = {AbstractFactoryPattern.class, BuilderPattern.class, - PrototypePattern.class}) + related = {AbstractFactoryPattern.class, BuilderPattern.class, + PrototypePattern.class}) public @interface SingletonPattern { - Class[] participants() default {}; - - String comment() default ""; - - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Singleton { Class[] participants() default {}; String comment() default ""; - Variation variation() default Variation.LAZY; - } + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Singleton { + Class[] participants() default {}; - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.METHOD) - @Documented - public @interface SingletonMethod { - Class[] participants() default {}; + String comment() default ""; - String comment() default ""; - } + Variation variation() default Variation.LAZY; + } + + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.METHOD) + @Documented + public @interface SingletonMethod { + Class[] participants() default {}; + + String comment() default ""; + } - public enum Variation { - LAZY, EAGER - } + public enum Variation { + LAZY, EAGER + } } diff --git a/src/main/java/org/jpatterns/gof/StatePattern.java b/src/main/java/org/jpatterns/gof/StatePattern.java index 5519de5..173cfde 100644 --- a/src/main/java/org/jpatterns/gof/StatePattern.java +++ b/src/main/java/org/jpatterns/gof/StatePattern.java @@ -1,13 +1,18 @@ package org.jpatterns.gof; -import org.jpatterns.core.*; +import org.jpatterns.core.DesignPattern; +import org.jpatterns.core.Type; -import java.lang.annotation.*; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; /** * Intent [GoF, pg 305]: Allow an object to alter its behavior when its * internal state changes. The object will appear to change its class. - *

      + *

      * State Structure * * @author Heinz Kabutz @@ -17,36 +22,36 @@ @Target(ElementType.TYPE) @Documented @DesignPattern(type = Type.BEHAVIORAL, - related = {FlyweightPattern.class, SingletonPattern.class}) + related = {FlyweightPattern.class, SingletonPattern.class}) public @interface StatePattern { - Class[] participants() default {}; - - String comment() default ""; - - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Context { Class[] participants() default {}; String comment() default ""; - } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface State { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Context { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface ConcreteState { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface State { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } + + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface ConcreteState { + Class[] participants() default {}; + + String comment() default ""; + } } diff --git a/src/main/java/org/jpatterns/gof/StrategyPattern.java b/src/main/java/org/jpatterns/gof/StrategyPattern.java index 52b8a40..ac7e6a1 100644 --- a/src/main/java/org/jpatterns/gof/StrategyPattern.java +++ b/src/main/java/org/jpatterns/gof/StrategyPattern.java @@ -1,14 +1,19 @@ package org.jpatterns.gof; -import org.jpatterns.core.*; +import org.jpatterns.core.DesignPattern; +import org.jpatterns.core.Type; -import java.lang.annotation.*; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; /** * Intent [GoF, pg 315]: Define a family of algorithms, encapsulate each * one, and make them interchangeable. Strategy lets the algorithm vary * independently from clients that use it. - *

      + *

      * Strategy Structure * * @author Heinz Kabutz @@ -18,45 +23,45 @@ @Target(ElementType.TYPE) @Documented @DesignPattern(type = Type.BEHAVIORAL, - related = {FlyweightPattern.class}) + related = {FlyweightPattern.class}) public @interface StrategyPattern { - Class[] participants() default {}; - - String comment() default ""; - - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Context { Class[] participants() default {}; String comment() default ""; - } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Strategy { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Context { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.FIELD) - @Documented - public @interface StrategyField { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Strategy { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface ConcreteStrategy { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.FIELD) + @Documented + public @interface StrategyField { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } + + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface ConcreteStrategy { + Class[] participants() default {}; + + String comment() default ""; + } } diff --git a/src/main/java/org/jpatterns/gof/TemplateMethodPattern.java b/src/main/java/org/jpatterns/gof/TemplateMethodPattern.java index 04df70a..8fb921a 100644 --- a/src/main/java/org/jpatterns/gof/TemplateMethodPattern.java +++ b/src/main/java/org/jpatterns/gof/TemplateMethodPattern.java @@ -1,15 +1,20 @@ package org.jpatterns.gof; -import org.jpatterns.core.*; +import org.jpatterns.core.DesignPattern; +import org.jpatterns.core.Type; -import java.lang.annotation.*; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; /** * Intent [GoF, pg 325]: Define the skeleton of an algorithm in an * operation, deferring some steps to subclasses. Template Method lets * subclasses redefine certain steps of an algorithm without changing the * algorithm's structure. - *

      + *

      * Template Method Structure * * @author Heinz Kabutz @@ -19,59 +24,59 @@ @Target({ElementType.TYPE, ElementType.METHOD}) @Documented @DesignPattern(type = Type.BEHAVIORAL, - related = {FactoryMethodPattern.class, StrategyPattern.class}) + related = {FactoryMethodPattern.class, StrategyPattern.class}) public @interface TemplateMethodPattern { - Class[] participants() default {}; - - String comment() default ""; - - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface AbstractClass { Class[] participants() default {}; String comment() default ""; - } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface ConcreteClass { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface AbstractClass { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.METHOD) - @Documented - public @interface TemplateMethod { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface ConcreteClass { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.METHOD) + @Documented + public @interface TemplateMethod { + Class[] participants() default {}; - /** - * @deprecated Misnamed, please use @PrimitiveOperation instead. - */ - @Deprecated - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.METHOD) - @Documented - public @interface PrimitiveMethod { - Class[] participants() default {}; + String comment() default ""; + } - String comment() default ""; - } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.METHOD) - @Documented - public @interface PrimitiveOperation { - Class[] participants() default {}; + /** + * @deprecated Misnamed, please use @PrimitiveOperation instead. + */ + @Deprecated + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.METHOD) + @Documented + public @interface PrimitiveMethod { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } + + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.METHOD) + @Documented + public @interface PrimitiveOperation { + Class[] participants() default {}; + + String comment() default ""; + } } diff --git a/src/main/java/org/jpatterns/gof/VisitorPattern.java b/src/main/java/org/jpatterns/gof/VisitorPattern.java index e0ae81e..2ba7e5b 100644 --- a/src/main/java/org/jpatterns/gof/VisitorPattern.java +++ b/src/main/java/org/jpatterns/gof/VisitorPattern.java @@ -1,14 +1,19 @@ package org.jpatterns.gof; -import org.jpatterns.core.*; +import org.jpatterns.core.DesignPattern; +import org.jpatterns.core.Type; -import java.lang.annotation.*; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; /** * Intent [GoF, pg 331]: Represent an operation to be performed on the * elements of an object structure. Visitor lets you define a new operation * without changing the classes of the elements on which it operates. - *

      + *

      * Visitor Structure * * @author Heinz Kabutz @@ -18,54 +23,54 @@ @Target(ElementType.TYPE) @Documented @DesignPattern(type = Type.BEHAVIORAL, - related = {CompositePattern.class, InterpreterPattern.class}) + related = {CompositePattern.class, InterpreterPattern.class}) public @interface VisitorPattern { - Class[] participants() default {}; - - String comment() default ""; - - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Visitor { Class[] participants() default {}; String comment() default ""; - } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface ConcreteVisitor { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Visitor { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Element { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface ConcreteVisitor { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface ConcreteElement { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Element { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface ObjectStructure { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface ConcreteElement { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } + + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface ObjectStructure { + Class[] participants() default {}; + + String comment() default ""; + } } diff --git a/src/main/java/org/jpatterns/jee/BusinessDelegatePattern.java b/src/main/java/org/jpatterns/jee/BusinessDelegatePattern.java index 3944053..bec78ca 100644 --- a/src/main/java/org/jpatterns/jee/BusinessDelegatePattern.java +++ b/src/main/java/org/jpatterns/jee/BusinessDelegatePattern.java @@ -3,20 +3,25 @@ */ package org.jpatterns.jee; -import org.jpatterns.core.*; +import org.jpatterns.core.DesignPattern; +import org.jpatterns.core.Source; +import org.jpatterns.core.Type; import org.jpatterns.gof.AdapterPattern.Adapter; import org.jpatterns.gof.FacadePattern; -import java.lang.annotation.*; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; /** * Intent [Core J2EE Patterns, pg 249]: use a BusinessDelegate to reduce * coupling between presentation-tier clients and business services. The * BusinessDelegate hides the underlying implementation details of the business * service [...]. - *

      - * - *

      + *

      + * Business Delegate Structure * * @author Marco Tedone * @since 2010-08-21 @@ -25,29 +30,29 @@ @Target({ElementType.TYPE}) @Documented @DesignPattern(source = Source.CoreJ2EE, type = Type.ENTERPRISE, - related = {Adapter.class, FacadePattern.class}) + related = {Adapter.class, FacadePattern.class}) public @interface BusinessDelegatePattern { - Class[] participants() default {}; - - String comment() default ""; - - @Retention(RetentionPolicy.RUNTIME) - @Target({ElementType.TYPE, ElementType.FIELD, ElementType.LOCAL_VARIABLE, - ElementType.PARAMETER}) - @Documented - public @interface BusinessDelegate { Class[] participants() default {}; String comment() default ""; - } - @Retention(RetentionPolicy.RUNTIME) - @Target({ElementType.TYPE, ElementType.FIELD, ElementType.LOCAL_VARIABLE, - ElementType.PARAMETER}) - @Documented - public @interface BusinessService { - Class[] participants() default {}; - - String comment() default ""; - } + @Retention(RetentionPolicy.RUNTIME) + @Target({ElementType.TYPE, ElementType.FIELD, ElementType.LOCAL_VARIABLE, + ElementType.PARAMETER}) + @Documented + public @interface BusinessDelegate { + Class[] participants() default {}; + + String comment() default ""; + } + + @Retention(RetentionPolicy.RUNTIME) + @Target({ElementType.TYPE, ElementType.FIELD, ElementType.LOCAL_VARIABLE, + ElementType.PARAMETER}) + @Documented + public @interface BusinessService { + Class[] participants() default {}; + + String comment() default ""; + } } diff --git a/src/main/java/org/jpatterns/jee/DataAccessObjectPattern.java b/src/main/java/org/jpatterns/jee/DataAccessObjectPattern.java index 5f9a9e7..a4508c4 100644 --- a/src/main/java/org/jpatterns/jee/DataAccessObjectPattern.java +++ b/src/main/java/org/jpatterns/jee/DataAccessObjectPattern.java @@ -3,17 +3,22 @@ */ package org.jpatterns.jee; -import org.jpatterns.core.*; +import org.jpatterns.core.DesignPattern; +import org.jpatterns.core.Source; +import org.jpatterns.core.Type; -import java.lang.annotation.*; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; /** * Intent [Core J2EE Patterns, pg 391]: Abstract and encapsulate all * access to the data source. The DAO manages the connection with the data * source to obtain and store data - *

      + *

      * DAO Structure - *

      * * @author Marco Tedone * @since 2010-08-19 @@ -22,60 +27,60 @@ @Target(ElementType.TYPE) @Documented @DesignPattern(source = Source.CoreJ2EE, - type = Type.ENTERPRISE) + type = Type.ENTERPRISE) public @interface DataAccessObjectPattern { - Class[] participants() default {}; - - String comment() default ""; - - @Retention(RetentionPolicy.RUNTIME) - @Target({ElementType.TYPE, ElementType.FIELD, - ElementType.LOCAL_VARIABLE, ElementType.PARAMETER}) - @Documented - public @interface BusinessObject { - Class[] participants() default {}; - - String comment() default ""; - } - - @Retention(RetentionPolicy.RUNTIME) - @Target({ElementType.TYPE, ElementType.FIELD, - ElementType.LOCAL_VARIABLE, ElementType.PARAMETER}) - @Documented - public @interface Dao { - Class[] participants() default {}; - - String comment() default ""; - } - - @Retention(RetentionPolicy.RUNTIME) - @Target({ElementType.TYPE, ElementType.FIELD, - ElementType.LOCAL_VARIABLE, ElementType.PARAMETER}) - @Documented - public @interface DataSource { - Class[] participants() default {}; - - String comment() default ""; - - // Giving users the possibility to specify which datasource they are using - // might be useful for maintainance. The information is optional anyway - - DataSourceType dataSourceType() default DataSourceType.UNDEFINED; - } - - @Retention(RetentionPolicy.RUNTIME) - @Target({ElementType.TYPE, ElementType.FIELD, - ElementType.LOCAL_VARIABLE, ElementType.PARAMETER}) - @Documented - public @interface ValueObject { Class[] participants() default {}; String comment() default ""; - } - public enum DataSourceType { - HIBERNATE, SPRING, ORACLE, DB2, MYSQL, SQLSERVER, SYBASE, BERKELEY, - UNDEFINED - } + @Retention(RetentionPolicy.RUNTIME) + @Target({ElementType.TYPE, ElementType.FIELD, + ElementType.LOCAL_VARIABLE, ElementType.PARAMETER}) + @Documented + public @interface BusinessObject { + Class[] participants() default {}; + + String comment() default ""; + } + + @Retention(RetentionPolicy.RUNTIME) + @Target({ElementType.TYPE, ElementType.FIELD, + ElementType.LOCAL_VARIABLE, ElementType.PARAMETER}) + @Documented + public @interface Dao { + Class[] participants() default {}; + + String comment() default ""; + } + + @Retention(RetentionPolicy.RUNTIME) + @Target({ElementType.TYPE, ElementType.FIELD, + ElementType.LOCAL_VARIABLE, ElementType.PARAMETER}) + @Documented + public @interface DataSource { + Class[] participants() default {}; + + String comment() default ""; + + // Giving users the possibility to specify which datasource they are using + // might be useful for maintainance. The information is optional anyway + + DataSourceType dataSourceType() default DataSourceType.UNDEFINED; + } + + @Retention(RetentionPolicy.RUNTIME) + @Target({ElementType.TYPE, ElementType.FIELD, + ElementType.LOCAL_VARIABLE, ElementType.PARAMETER}) + @Documented + public @interface ValueObject { + Class[] participants() default {}; + + String comment() default ""; + } + + public enum DataSourceType { + HIBERNATE, SPRING, ORACLE, DB2, MYSQL, SQLSERVER, SYBASE, BERKELEY, + UNDEFINED + } } diff --git a/src/main/java/org/jpatterns/jee/ModelViewController.java b/src/main/java/org/jpatterns/jee/ModelViewController.java index 70a789f..1d61d18 100644 --- a/src/main/java/org/jpatterns/jee/ModelViewController.java +++ b/src/main/java/org/jpatterns/jee/ModelViewController.java @@ -1,8 +1,14 @@ package org.jpatterns.jee; -import org.jpatterns.core.*; +import org.jpatterns.core.DesignPattern; +import org.jpatterns.core.Source; +import org.jpatterns.core.Type; -import java.lang.annotation.*; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; /** * Intent: The Model View Controller (MVC) pattern divides an application in @@ -13,11 +19,10 @@ * things done and dispatches to the appropriate view a response to the request * (this response might contain objects from the Model) *

    • The Model wraps the logic and the domain model of the application, - * offering both services and objects to the view
    • . + * offering both services and objects to the view. *
    - *

    + *

    * Mediator Structure - *

    * * @author Marco Tedone * @since 2010-08-21 @@ -26,36 +31,36 @@ @Target({ElementType.TYPE}) @Documented @DesignPattern(source = Source.Other, - type = Type.ENTERPRISE) + type = Type.ENTERPRISE) public @interface ModelViewController { - Class[] participants() default {}; - - String comment() default ""; - - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface View { Class[] participants() default {}; String comment() default ""; - } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Controller { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface View { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface Model { - Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Controller { + Class[] participants() default {}; - String comment() default ""; - } + String comment() default ""; + } + + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface Model { + Class[] participants() default {}; + + String comment() default ""; + } } \ No newline at end of file diff --git a/src/main/java/org/jpatterns/jee/package-info.java b/src/main/java/org/jpatterns/jee/package-info.java index 269c986..c779517 100644 --- a/src/main/java/org/jpatterns/jee/package-info.java +++ b/src/main/java/org/jpatterns/jee/package-info.java @@ -1,9 +1,9 @@ /** - * This file contains {@link org.jpatterns.core.Type#ENTERPRISE} patterns as + * This file contains {@link org.jpatterns.core.Type#ENTERPRISE} patterns as * described in the CORE J2EE Patterns 2nd Edition - Best Practices and Design * Strategies book. - *

    - * Although some of the EE patterns described in this book are obsolete, + *

    + * Although some of the EE patterns described in this book are obsolete, * others are still actual and defined in this package. * * @author Marco Tedone diff --git a/src/main/java/org/jpatterns/plopd/NullObjectPattern.java b/src/main/java/org/jpatterns/plopd/NullObjectPattern.java index ad413eb..21abe02 100644 --- a/src/main/java/org/jpatterns/plopd/NullObjectPattern.java +++ b/src/main/java/org/jpatterns/plopd/NullObjectPattern.java @@ -1,9 +1,17 @@ package org.jpatterns.plopd; -import org.jpatterns.core.*; -import org.jpatterns.gof.*; +import org.jpatterns.core.DesignPattern; +import org.jpatterns.core.Source; +import org.jpatterns.core.Type; +import org.jpatterns.gof.FlyweightPattern; +import org.jpatterns.gof.SingletonPattern; +import org.jpatterns.gof.StrategyPattern; -import java.lang.annotation.*; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; /** * Intent [PLoPD3, pg 5]: A Null Object provides a surrogate for another @@ -16,52 +24,52 @@ */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE, ElementType.FIELD, - ElementType.LOCAL_VARIABLE}) + ElementType.LOCAL_VARIABLE}) @Documented @DesignPattern( - source = Source.PLoPD3, - type = Type.BEHAVIORAL, - related = {FlyweightPattern.class, StrategyPattern.class, - SingletonPattern.class}) + source = Source.PLoPD3, + type = Type.BEHAVIORAL, + related = {FlyweightPattern.class, StrategyPattern.class, + SingletonPattern.class}) public @interface NullObjectPattern { - public abstract Class[] participants() default {}; - - public abstract String comment() default ""; - - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface AbstractObject { public abstract Class[] participants() default {}; public abstract String comment() default ""; - } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface RealObject { - public abstract Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface AbstractObject { + public abstract Class[] participants() default {}; - public abstract String comment() default ""; - } + public abstract String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Documented - public @interface NullObject { - public abstract Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface RealObject { + public abstract Class[] participants() default {}; - public abstract String comment() default ""; - } + public abstract String comment() default ""; + } - @Retention(RetentionPolicy.RUNTIME) - @Target({ElementType.TYPE, ElementType.FIELD, - ElementType.LOCAL_VARIABLE}) - @Documented - public @interface Client { - public abstract Class[] participants() default {}; + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + @Documented + public @interface NullObject { + public abstract Class[] participants() default {}; - public abstract String comment() default ""; - } + public abstract String comment() default ""; + } + + @Retention(RetentionPolicy.RUNTIME) + @Target({ElementType.TYPE, ElementType.FIELD, + ElementType.LOCAL_VARIABLE}) + @Documented + public @interface Client { + public abstract Class[] participants() default {}; + + public abstract String comment() default ""; + } }