Software development is craftsmanship and art.

From business ideas to software products:
we take care of the complete lifecycle.

Direct call pattern

Everybody knows that the best way for objects to collaborate involves a lot of annotations (see for example Spring and EJB), some XML (Spring and EJB again), even more XML (Oracle ADF) and even some drag and drop in an obscure visual editor (ADF again). This is the industry standard, and it is pretty good, because consultants can make a lot of money, and consulting companies can bring in even more consultants into projects.

Anyway, there might be situations where you need something different, so Oliver Szymanski and David Tanzer have invented the direct call pattern (in a cocktail bar) a couple of years ago (BTW, you can use the text of the pattern without permission, as long as you clearly mention our names - that is Oliver Szymanski and David Tanzer)

Introduction

Also known as Collaborateur-With-No-Intermediator pattern; by Oliver Szymanski and David Tanzer

2 Objects want to communicate with each other. One is the caller, the other the callee. The callee is fine with that and the caller does everything that is needed before and after the call gratefully on his own.

Requirements

2 Objects, sometimes 1 Object in 2 roles (Caller, Callee) Nothing else

We recommend that you install appropriateand up to date anti-virus software and any other necessary protective software before you download information from this website. We do not accept responsibility for any virus or similar item contracted as a result of visiting this website or any other website and will not be liable for any loss, damage, costs, expenses or claims suffered or incurred by you or any person as a consequence of the presence of any virus or similar item on this website or any other website (whether linked or not to this website).

These terms and conditions are governed by the laws of England and by using this website you agree to submit to the non-exclusive jurisdiction of the English courts in relation to any dispute or claim in relation to these terms and conditions.

Solution

The caller calls the callee directly. No proxy, interceptor, or any other intermediator objects are involved in this call. Really, just one call from one trusted friend to another. Perhaps third party is logging the call, but that is hard to avoid in these times.

Pros

Fast call

Clean stack traces

Less confusion

What you see is what will happen

Contra

Lots of "WTF is the dependency injection" and "how do I find the interceptor" comments

Sucks the non-needed annotation and aspect orientation stuff

People could understand what you have written

Less money with the software support

Use when

No money for application server

Not the time to debug frameworks

Long times of exclusive consulting not longed for

Project will be running for more than a few weeks/month (and you should make the support)

© IT Consulting Oliver Szymanski 2018

Terms and Conditons