header parallax image
uncoditional

code liberated

  • Home
  • Pete
  • Home
  • Pete
CFML & Mach-II

CFML-MachII and AJAX architecture

October 18, 2012Peter Lombardo2941 views

This being my first post, I will not start out light.  I have spent 6 months getting my feet wet with Mach-II and am facing a conundrum…, of course, meanwhile my boss (our local expert) is on vacation!   So, here goes…

Requirement: Have one package (domain) call another, where both domains are formatting JSON.  I have worked with MII for 6 months and am now building a form generator.  To work with the validation library (idealforms) I have chosen, I have a Question library which formats the JSON at the View layer.  Now for a different requirement, I need the whole form to be passed back as one big JSON to the browser.  What layer of Form library should talk to what layer of the Question library. For example, should I move the Question JSON-formatting to the Question library’s Listener level and have the Form library talk to it from the controller level?

Here’s what the experts have said:

  • Co-worker: Have session layer talk to service layer.  So, in essence, the Question session (formQuestionService.cfc) format the individual question JSON objects.
  • Online Forum: “I think communicating on the controller level would work. The other option would be to create a remote service CFC and have it expose remote methods that you can call via JS accepting and return JSON. Finally you could take a look at the new endpoints feature in Mach II 1.9 which was setup to provide nice infrastucture for REST based services which is basically what you are building.” … “If you are going to use the listener I would format the json as part of the listener code or as part of the view code. I try to make sure my service layer doesn’t know about json or html unless I make a special remote service whose job it is to just deal with json from the browser.“

I was going with the co-worker’s plan because she can forecast the Boss’ more subtle requirements better than anyone, but the bolded part about the listner level makes even more sense.  Happy Mach-ing!

jsonMach-IItechnology
  • tweet
next story

Simple Diagram of MVC/Mach-II

Peter Lombardo

Peter Lombardo

Web developer too long.

you might also like

CFScript Components and OO notes

June 12, 2015

Simple Diagram of MVC/Mach-II

October 18, 2012

Extracting Header rows from .cfmail file

May 11, 2015

Leave a Response Cancel reply

You must be logged in to post a comment.

about me

uncoditional

Pete Lombardo

I like people and coding. Both change. Twenty years of full-stack development. I live in Maryland.

Recent Posts

  •   lives on!
    									
  • Cannot find module ‘…/…’ or its corresponding type declarations.
  • *ngIf – use parentheses
  • Angular component code block execution order
  • material dialog- how to get response data .subscribe()

Recent Comments

    Archives

    • June 2022
    • March 2022
    • June 2020
    • June 2019
    • November 2017
    • October 2017
    • September 2017
    • August 2017
    • June 2017
    • June 2015
    • May 2015
    • April 2015
    • October 2014
    • September 2014
    • July 2014
    • June 2014
    • May 2013
    • February 2013
    • January 2013
    • November 2012
    • October 2012

    Categories

    • angular
    • AWS
    • before the code
    • Browser Support
    • CFML & Mach-II
    • Chromebook
    • ckEditor
    • CloudSearch
    • ColdFusion
    • Java
    • javascript/typescript
    • JQuery and CSS
    • Languages
    • Life
    • material design
    • project
    • Projects
    • SNS
    • SQL
    • Tools
    • Uncategorized
    • unCODitional

    Meta

    • Log in
    • Entries feed
    • Comments feed
    • WordPress.org
    0
    Followers
    0
    Followers
    0
    Followers
    0
    Followers

    Follow @ Instagram

    Configuration error or no pictures...