The Wrapper pattern provided by Java Architect can be used to implement either a Delegate pattern or a Proxy pattern. It can be applied on a class that is called the Subject.
The Delegate pattern creates a class that reproduces the public interface of the Subject class (its public methods possibly inherited) and delegates the corresponding calls to these methods to its delegated object which is a instance of the Subject class. However, the delegate class does not share a modeled interface with its subject.
The Proxy pattern is similar in that it also forwards calls to its methods to its wrapped object which is a Subject class instance too. However, the proxy is made to also be, in the inheritance meaning, a Subject itself. Java Architect will create this shared interface for you.
Applying the Delegate pattern
-
In the model, select the existing class which you want to create a delegate for.
-
From the contextual menu (rightclick) execute the
Java Architect →
Patterns → Create Wrapper command.
-
The command will display the following GUI once you have selected the Delegate radio button.

-
Choose how inherited methods of the Subject are processed:
-
Ignore: The delegate class will only expose the public methods of the Subject class (the inherited public methods are ignored)
-
Copy on Wrapper: The delegate class will expose both the public methods of the Subject class itself and all its inherited public methods.
-
Reproduce inheritance tree: The delegate class will expose the public methods of the Subject itself. However, in order to support inherited methods, the delegate class will be placed in an inheritance tree of additional delegate classes that reproduce the Subject inheritance tree.
-
-
Press the OK button to apply the pattern and create the Delegate class model.
![]() |
The Lazy loading parameter is not used by the Delegate pattern and therefore remains greyed. |
![]() |
The diagram displayed in the dialog shows a useful generic preview of the model that the pattern will create. |
Applying the Proxy pattern
-
In the model, select the existing class which you want to create a proxy for.
-
From the contextual menu (rightclick) execute the
Java Architect →
Patterns → Create Wrapper command.
-
The command will display the following GUI once you have selected the Proxy radio button.

-
Choose how inherited methods of the Subject are processed:
-
Ignore: The proxy class will only expose the public methods of the Subject class (the inherited public methods are ignored)
-
Copy on Wrapper: The proxy class will expose both the public methods of the Subject class itself and all its inherited public methods.
-
Reproduce inheritance tree: The proxy class will expose the public methods of the Subject itself. However, in order to support inherited methods, the proxy interface will be placed in an inheritance tree of additional proxy interfaces that reproduce the Subject inheritance tree.
-
-
Select the Lazy loading option value. If set, the generated proxy will apply a lazy loading strategy to initialize its wrapped object.
-
Press the OK button to apply the pattern and create the Proxy class model.
![]() |
Lazy loading is typically recommended for heavyweight subject objects that cost a lot of system resources by being always up. Lazy loading ensures to allocate these expensive wrapped objects only if needed, ie at the first call to a method of the proxy. |
![]() |
The diagram displayed in the dialog shows a useful generic preview of the model that the pattern will create. |