Query on best practices for coding.

27 views
Skip to first unread message

Segaram

unread,
Sep 22, 2022, 1:14:41 PMSep 22
to jPOS Users
Hello ! 
I have the following code dilemma: 

-- The restricted & simplified question --
A participant in a DS must translate the incoming ISO8583 request to an external 3rd. party message format, just before sending it via QueryHost. This translation is rather straightforward.

Case a) Translation is done in ( or by ) the participant itself
Case b) Participant instantiates a translator class and calls this class's methods.
f
In case a) the participant itself does the translation job . This is rather the practical solution. If the same target format is needed in the future but with additional data, another participant may call super.xLate( theRequest ). 

In case b), the participant is just an orchestrator, and instantiates a translator class xLator = new ISO23rdParty() ; xLator.xLate( the Request ) . This is rather the academic solution.

Which, case a) or case b), is the solution that fits best practices in jpos domain ?

Now -- The general question --

To delegate all that is possible, or not to delegate at all ( or delegate the minimum ) ?




Alejandro Revilla

unread,
Sep 22, 2022, 1:17:26 PMSep 22
to jpos-...@googlegroups.com
It depends on how complex the translation is and how reusable for similar implementations your code is.

I'd probably go with the latter, as a matter of fact, that's what we tend to do. Use a translator for most of the message, and perhaps tweak it a bit as part of the specific participant.



--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/f6c1de43-ac7f-4802-b5bd-5d8fac07c29en%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages