Thursday, December 2, 2010

Brooklyn Bridge Blueprint

Direct-call design pattern

Wie jeder weiss, schliesst die beste Art und Weise Objekte miteinander kollaborieren zu lassen Annotationen (siehe Spring und EJB für Beispiele), einiges an XML (wieder mit einem Blick auf Spring und EJB), noch mehr XML (siehe Oracle ADF) und dazu Drag und Drop in einem obskuren visuellen Editor (z.B. wieder ADF) ein. Das ist Industriestandard und es ist wunderbar, denn Consultants can make as much money and consulting companies can even bring more consultants to projects.

However, there may be situations where we need something else. Therefore, we have David Tanzer and I developed the Direct-call pattern (in a cocktail bar).

Direct-call pattern [1]
(also known as Collaborateur-With-No-Inter mediator design type)

Introduction:
2 objects do together . Communicate One of the caller (caller), the other of the callee (callee) is. For the callee is perfectly fine and does everything the caller required before and after the call to love themselves

requirements:
2 objects, sometimes an object in 2 rolls (caller, callee )
Nothing else

solution:
The caller calls the callee directly. No proxy, or otherwise Interceptior an intermediary object involved in the call. Really, just a call from a trusted Friend to another. Perhaps a third party signed the call, but that can now avoid.

Pros:
Quick access
Clean and short stack traces
Less confusion
WYSIWYG

Cons:
Many "WTF here is the Dependency Injection" and "I think the Interceptor Comments
Displeased not required annotations and aspect-orientation stuff
Andere können den Code verstehen, den man geschrieben hat
Weniger Geld mit Software Support

Nutzen wenn:
Kein Geld für Application Server vorhanden
Keine Zeit um Frameworks zu debuggen
Man sich nicht nach langen Zeiten voller exklusivem Consulting sehnt
Projekt-Laufzeit länger als einige Wochen/Monate (und man soll sich selbst ohne Aufpreis um den Support kümmern)

0 comments:

Post a Comment