Skip to content
* / softthoughts

Loose coupling modules with the Ax messaging module (AMM)

In the post of Quality provided by the AMM loose coupling was shortly discussed. In this post I try to elaborate a little more.

Dynamics Ax: In Dynamics Ax the domain specific modules exist very clearly on a conceptual level. The principle of separation of concern is brought visual to the business analysts and the users of the system. This is very important for them so the required knowledge to execute their job can be minimized and more manageable.
Technically in the design separation of concern is also applied, although the coupling between the modules is mainly strong. This can be a problem if there are 2 very separate development teams working on their own module and which depend on eachother. The evolution of their modules demand more management to keep providing the same functionality and quality. In spite of this, all the standard functionality in Dynamics Ax is under control of Microsoft. This results that the strong coupling problem is less relevant. Teams can still work closely together. If a module needs functionality of another module it will use it directly. Fine grained or coarse grained functionality in a standard Ax module is for them, what module communication matters, less important and performance is maximized. This also implicates that for the microsoft teams developing against a well defined interface of every Ax module is not a big issue, although there are still interfaces to look for.

AMM: For companies that want to use Dynamics Ax to provide a module that is less depended on the code and evolution of the (standard) Ax modules and which follows a more a service oriented approach the AMM offers a possible solution. The module offers messages as its main concept of communication. If for example an event occurs like “AddressCreated” in an address module, it sends this event (message) on a channel. The address module itself has no relation with the other modules.

If the other modules want to do some processing after that an address is created, they can do it in a context of full separation of concerns by capturing the “AddressCreated” event. This principle helps to reduce the dependency between modules and during evolution. They code their own event handler that does their required processing. This provides clear code for every module after picking up a message. Code which is separated from the code of the address module and eachother.

The message is the interface and should during evolution stay compatible with previous message version. If the message changes strongly a second message could be send next to the old message, so the old “interface” is kept. This tactic allows the address module to be installed on every Dynamics Ax environment easily together with the AMM.

What modules do with the messages that the address module send is not relevant for the Address module. For the address module the processing after receiving a message is a variation point of the address module architecture. Other modules can place their processing after the receiving of a message. The code of the address module demands no change for extra processing.

The modules that use data from the address module can use the messages of the address module (listening to a message or sending a message in the address module). This in a service oriented way (service contract, reusable, abstract, lose coupled, stateless, autonomy, composable). The message bus forms a simple service-oriented architecture. The strict use of service orientation is not required in the Dynamics Ax modules. For reading address data the tables of the address module can still be accessed directly. This is for example possibly needed to show address data in the UI.

A disadvantage of the use of every abstraction or framework instead of strong coupling or spaghetti code is the implication of some execution overhead. This is not different with the messaging module.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: