GryphonsClaw
Programmer
What is the best practice for separating business logic from presentation?
I do a lot of simple programming on our intranet site, mostly form submit to query a database and display a report. I have a CFC that does the query and a cfm that loops through the returned query variable and displays the results. If I am looking to do multiple actions based on the form, would it be best to pass the form variable to the CFC and do the logic there.
An example would be the user selects to filter a report by customer. I have the invoke on the cfm page where I look to see if the customer field is defined, if so I include the Customer argument of the components method. Sometimes I will invoke different methods based on the FORM fields selected. Should I just pass the FORM variable to the method and do this logic there? Am I over thinking this, and it really doesn't matter?
I do a lot of simple programming on our intranet site, mostly form submit to query a database and display a report. I have a CFC that does the query and a cfm that loops through the returned query variable and displays the results. If I am looking to do multiple actions based on the form, would it be best to pass the form variable to the CFC and do the logic there.
An example would be the user selects to filter a report by customer. I have the invoke on the cfm page where I look to see if the customer field is defined, if so I include the Customer argument of the components method. Sometimes I will invoke different methods based on the FORM fields selected. Should I just pass the FORM variable to the method and do this logic there? Am I over thinking this, and it really doesn't matter?