Forum chevron_right Corda 5 – CorDapp Development chevron_right Corda 5 Finality flow in seperate file.

  • Creator
  • #11378
    Peter Li
    In Corda 5 CSDE template chat app, the finality flow is written in a seperate file. What is the logic behind isolating the finality flow to a separate file? the FinalizeChatSubFlow
    I have a guess:
    1. isolate the initiating <> responding action to separate file, easier to debug?
    2. less file annotated with @InitiatingFlow ?
Viewing 1 replies (of 1 total)
  • Author
  • #11379
    Peter Li

    The reason is quite simple. It is to avoids duplication of code, which is easier to debug.  And more that there’s no need to write it twice as the responder logic is identical in both.

    That is, for flows that share the similar responder logic, they all should try to have the finalization code in a seperate file and keep re-use it.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.

Subscribe to our newsletter to stay up to date on the latest developer news, tools, and articles.