I would recommend putting business logic in the service layer were it can
be used by more then just the Mach II part of the app. For example say you
wanted to create a web service or remote access from Flex to same business
logic you would want that code to be in the service layer that way it could
be call from outside a Mach II app if necessary. Typically I just have the
Mach II listeners deal with taking values from the form scope and putting
them into domain objects and then I have my services to do all the other
logic.

--Kurt

On Fri, Oct 5, 2012 at 9:50 AM, [email protected] <[email protected]>wrote:

> I have been developing on an older version of of machii (1.5) for a while
> now.
>
> I am just reading up on the current documentation on the wiki.
> I have not been keeping up with machii coding practices due to not having
> enough time.
>
> Looking back at old documentation it was once suggested that the Listeners
> should include business logic.
>
> Reference :
> http://www.mach-ii.com/resources/how_to_develop_listeners_for_mach-ii.pdf
>
> But looking at the wiki this has changed.
>
> "Things that should not go in your listener:
> Business logic (ie; calculating a tax rate, checking to see if a user
> already has an account in your system, etc.)
> "
> Reference : http://trac.mach-ii.com/machii/wiki/IntroToListeners
>
> So if for example I needed to loop over some data from a database , parse
> some form data and then do some calculations using both form and database
> data.
>
> Where would be the best place to put this logic since I currently have it
> within my listener.
>
> As far as I understand it .. all database SQL would go into the service
> layer... so where would my business logic example above be placed?
>
> Thanks for your help!!
>
>
>
>
>  --
> --
> To post to this group, send email to
> [email protected]
> For more options and to unsubscribe, visit this group at
> http://groups.google.com/group/mach-ii-for-coldfusion?hl=en
>
> New (July 2012): We've moved to GitHub:
> https://github.com/Mach-II/Mach-II-Framework
>
>
>

-- 
-- 
To post to this group, send email to [email protected]
For more options and to unsubscribe, visit this group at 
http://groups.google.com/group/mach-ii-for-coldfusion?hl=en

New (July 2012): We've moved to GitHub: 
https://github.com/Mach-II/Mach-II-Framework


Reply via email to