I was doing a technical interview the other day and I got a question that really threw me. The question, if I remember it correctly, was "What are the mappings in either Cairngorm and/or PureMVC?" What threw me was the word "mapping". So off I go to Google to try to find the answer…
For PureMVC I found the word "mapping" being used in an FAQ post describing a best practice for listing out constants that map the commands/notifications for the application.
http://puremvc.org/content/view/93/188/
Just to highlight a point the FAQ post makes, it’s what to do with all the constants that would be created with a larger application. I have created a couple of apps where we would have 50+ constants defined in the ApplicationFacade that would then clutter up the code and make it harder to search out issues in the code. My recommendation is for all PureMVC applications to have its constants in a separate file (ie: AppConstants or something to that effect) for defining all the constants for the app. This allows comments with the constants as well as the option to organize them to the same flow as the UML or storyboards. In an agile development environment it is imperative that code be well organized to provide the ability locate and change aspects of the application at a faster rate. Having the ability to search one file and then allow the Flex IDE to search out uses of the definitions makes debugging issues less of a choir.
For Cairngorm I felt the word "mapping" had the same meaning as it would for PureMVC but implemented in a different way. Cairngorm uses a process of mapping Commands to Events and is done within the Controller file. I have seen developers separate out the Event name constants into it’s own file and then importing the file into all the individual event scripts. Another way, is to simply define the constant(s) name within the Event itself and make the constant name the same as the Event name and file name. Keeping everything named consistently makes searching an issue or change easier to do. Again, since the event files define their constant names within themselves, I name the file the same as to what the constant name would be for the Event. Keep the name descriptive as to what the Event is meant to accomplish.
The following link to to the Cairngorm introduction:
http://www.adobe.com/devnet/flex/articles/introducing_cairngorm/introducing_cairngorm.pdf
In the end I am sure there are several other ways to "mapping" your processes and constants out in your Flex applications using the above micro frameworks. A word of advice is to create a process and stick with it. Keeping your code organized and commented is key to adding value behind your coding work. If the code is unmaintainable then its garbage.
I know, I know… I haven’t posted anything yet except for my lame excuse about loosing my last blog due to me being an artard and not backing up my site. BUT, I’ve been kind of busy lately with work and holding on to a job since this whole economic down turn is making it very difficult with finding the next consulting gig. I have witnessed the heart ache of a lot of good friends as they are impacted with loosing their jobs because of cut backs within the walls of the big companies and the small. I have even heard of companies offering employees to move into a more junior position with pay cuts (you know like moving from an Architect role to help desk) in order to stay employed. So with that in mind I want to try something a little different on this go around with my technical blog. I want to provide some “no nonsense” tutorials and posts about getting started doing what I am doing as well as pointers on how to look for work and be able to sell yourself above your competitors.
With that in mind let me break down how I want to categorize the posts. There will be of course specific technical articles about different technologies. I will do my best to organize these going from Basic to Advanced. I will also share with you how I have done what I have done and how I compete with other contractors that are flooding the IT market place. Some posts will just be pointers and/or definitions of words to reflect on. Other posts will be multipart tutorials that may stretch across a couple of weeks. This blog is intended as my professional blog and will be as factual as possible. If something is of opinion I will ensure that it is marked accordingly.
In all I am offering all this for free. IT is my community and I want to be there to support you all as we go through rough times with the job market. I want to help out in any way I can. So if you are looking for help in a particular area let me know. I will do my best to answer you questions and/or at least point you in the right direction to work through your problem.
Most of all thanks for visiting my little piece of the internet world.
Well my server that I had my original blog on crapped out on me and I lost my entire site. So you will have to
forgive me if something you were searching for disappeared on you. I will try to rewrite old post, but no
promises. I probably will just move forward with my adventures in software development and continue with
some new and refreshing post.
See you soon!
J