130 likes | 296 Views
Macromedia MAX 2003. Mach-II Intro. Stephen Rittler CounterMarch Systems. Agenda. Genesis of Mach-ii Components of a Mach application Overview of a request/response cycle with Mach A peek under the covers of a functioning Mach application. Components. Mach-ii.xml <properties>
E N D
Macromedia MAX 2003 Mach-II Intro Stephen Rittler CounterMarch Systems
Agenda • Genesis of Mach-ii • Components of a Mach application • Overview of a request/response cycle with Mach • A peek under the covers of a functioning Mach application
Components • Mach-ii.xml • <properties> • <event-handler> • <page-view> • <listener> • Plugins and filters
Mach-ii.xml • The “controller” • Defines application flow • Lots of fun to work with in a development team!
Properties • The area of the XML file where you stash variables that you used to drop in Application.cfm <properties> <property name="applicationRoot" value="" /> <property name="defaultEvent" value="showWelcome" /> <property name="eventParameter" value="event" /> <property name="parameterPrecedence" value="form" /> <property name="maxEvents" value="10" /> <property name="exceptionEvent" value="exception" /> <property name="systemEventID" value="14" /> <property name="dsn" value=“{noneofyourbusiness}" /> <property name="dsn_ems" value="{noneofyourbusiness}" /> <property name="dsn_campus" value="{noneofyourbusiness}" /> <property name="dsn_forms" value="{noneofyourbusiness}" /> <property name="adminEmail" value="srittler@countermarch.com" /> <property name="senderEmailAddress" value="alumni@lehigh.edu" /> </properties>
Event handlers • Each action that a user takes (and some that are done implicitly) is an event • Each “event” is mapped to an “event-handler” in the xml file • Inside each event-handler are the data retrieval and display tags related to that event <event-handler event="ems_showCategories" access="public"> <notify listener="categoryManager" method="getCategories" resultKey="request.qCategories" /> <view-page name="ems_showCategories" contentKey="request.content" /> <view-page name="ems_appNavigation" contentKey="request.appNavigation" /> <view-page name="baseTemplate" /> </event-handler>
Page-view • A page-view is just display logic and any user input fields • There is no data retrieval in the view template. All data is passed in via request variables {real, live code demo}
Listeners • The “data go-getters” • They sit out there in application scope and wait to be called on {real, live code demo}
Plugins and Filters Stolen from Sean Corfield: • Rule of thumb: if you need to do it on every single request, event handler, or view, you should use a plugin. • If you need to perform some operation on data provided to certain events or listener methods, you should use a filter. The inner workings of plugins and filters are beyond the scope of today’s workshop. They are a great way to implement a login/security framework though!
Let’s look at an application! • Reviewing the request/response cycle
Lessons Learned • We’ve been developing applications using Mach-ii for a little over a year now • We were not Fusebox developers; learned from scratch with the Amkor guys (you rock!) • Spin-up time was FAST • Solid naming conventions are key to maintainability • Fundamentals of OOP are important • More learning in this area is warranted • Version control software is vital. The XML file changes frequently, especially on a large development team
Q and A • Questions? Comments?
Resources http://www.mach-ii.info/ http://tutorial345.easycfm.com/ http://livedocs.macromedia.com/wtg/public/machiidevguide/