<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:series="http://unfoldingneurons.com/"
	>

<channel>
	<title>AaronHardy.com &#187; framework</title>
	<atom:link href="http://aaronhardy.com/tag/framework/feed/" rel="self" type="application/rss+xml" />
	<link>http://aaronhardy.com</link>
	<description>For all your Aaron Hardy needs.</description>
	<lastBuildDate>Fri, 20 Apr 2012 14:53:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>JavaScript Architecture: The Basics</title>
		<link>http://aaronhardy.com/javascript/javascript-architecture-the-basics/</link>
		<comments>http://aaronhardy.com/javascript/javascript-architecture-the-basics/#comments</comments>
		<pubDate>Sun, 04 Dec 2011 00:06:18 +0000</pubDate>
		<dc:creator>Aaron Hardy</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[architect]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[WebStorm]]></category>

		<guid isPermaLink="false">http://aaronhardy.com/?p=1022</guid>
		<description><![CDATA[This post is intended to be the first of a series. I want to be clear about what it entails and its intended audience. For the past several years I&#8217;ve been an architect in enterprise-level RIAs. This is a fancy way of saying I oversee the design and construction of apps that are web-based but [...]]]></description>
			<content:encoded><![CDATA[<p>This post is intended to be the first of a series.  I want to be clear about what it entails and its intended audience.</p>
<p>For the past several years I&#8217;ve been an architect in enterprise-level RIAs.  This is a fancy way of saying I oversee the design and construction of apps that are web-based but have a lot of the same characteristics as desktop applications.  Some of the applications I work on <i>are</i> in fact desktop applications but heavily communicate with the web.  The line becomes very blurry, but the main point is&#8211;I deal with <i>applications</i> which in my world are quite different than what is often considered a &#8220;website&#8221; even though they both live within a browser.</p>
<p>There are others in the industry who do what I do or would like to do what I do.  Of those there are some who are new to JavaScript.  This is my intended audience.  An architect arriving at JavaScript for the first time has a lot to learn and many decisions to make.  As the lead architect on a product and being fairly new to JavaScript (well, modern JavaScript) I likewise had to go through this process and have spent countless hours re-learning JavaScript, testing IDEs, discovering communities, exploring deployment procedures, learning what questions to ask, evaluating libraries (mvc, dependency management, dom manipulation, testing, deployment, utilities) and putting all these things together to lead a team and produce an application worthy of enterprise consumption. My hope is to help others along the way.<span id="more-1022"></span></p>
<p>You might think this is a broad effort, but my goal is not to simply regurgitate everything I&#8217;ve learned but to help boil things down to what&#8217;s important to get you on your way.  We&#8217;ll discuss core principles that are common in dynamic apps regardless of the languages or libraries used.  However, to illustrate them and hopefully give you enough of a concrete example to help you hit the ground running, I&#8217;ll be using specific, hand-picked libraries for this series.  In your own research you may find other libraries are more appropriate for your particular project.  That&#8217;s fine; the principles in this series are still valuable and applicable.</p>
<h3>Choose wisely</h3>
<p>JavaScript is merely a language.  HTML is, for the most part, a set of dilapidated, relatively primitive components.  To reduce boilerplate, abstract browser inconsistencies, and provide engineers with higher-level tools to be more productive, all kinds of libraries have come out of the woodwork.  Because JavaScript and HTML leave out some basic structures and components that are so commonly needed, these libraries often overlap in functionality and features.  This also means some don&#8217;t play well together.  This is both exciting because you have so many options to choose from and yet frustrating because you have so many options to choose from.</p>
<p>As an architect, specifically in an enterprise setting, these decisions will be very important and can ultimately determine the fate of your product. If I were farting around on a side-project, I&#8217;d probably feel comfortable picking the most awesome-sounding libraries and running with them.  In the corporate world though, we have to answer some important questions:  Is our product part of a larger suite?  If so, what is the rest of the suite using?  If the rest of the suite were to standardize on a particular library, how hard would it be for us to refactor?  What if we chose a &#8220;full-stack&#8221; library and a portion of it is or becomes inferior to other options?  What&#8217;s the chance that a different library may overtake my library in community and technical progression?  What&#8217;s the community like around those libraries?  Which libraries are gaining steam or fizzling out?  What&#8217;s their learning curve? How easy is it to hire developers for these libraries?  It&#8217;s a very different ballgame so take care in your decisions. In my case, I found the best option was to pick a handful of high-quality tools with healthy communities that worked well together but were decoupled in their implementations.  <a href="http://grooveshark.com/" target="_blank">Grooveshark</a> provides <a href="http://blog.jerodsanto.net/2010/12/the-tech-behind-the-new-grooveshark/" target="_blank">a very interesting related case study</a>.</p>
<h3>Rolling your own</h3>
<p>There comes a time in every developer&#8217;s life where we get caught up in rolling our own libraries.  Maybe we think our work is superior, maybe we don&#8217;t do enough research on what&#8217;s already available, or maybe there&#8217;s just one small thing that isn&#8217;t quite right in a library so we rewrite it from scratch.  I&#8217;ve done it and you likely have too.  When determining what your team will use, it&#8217;s very important to keep in mind some of the significant benefits of going with a wisely-chosen 3rd-party/open-source library:</p>
<ul>
<li>Free development resources</li>
<li>Free documentation</li>
<li>Free bug fixes</li>
<li>Free testing by automated tests and other community members</li>
<li>Collaboration amongst generally intelligent industry leaders</li>
<li>A place to learn more and ask questions</li>
</ul>
<p>Far too often I&#8217;ve seen very intelligent architects roll their own libraries because they feel their skills are superior or are OCD that the libraries work exactly like they want and carries no extra baggage.  Very often, if that architect were to stay on the project forever, this would probably work out quite well and the product would be successful.  In reality, the architect leaves.  Almost always they were time-crunched and didn&#8217;t fully document the library, set up testing, or cross-train their co-workers.  They developed the library for the purpose of fulfilling the specific needs of a project and even though the library may have been a fantastic work of art, the engineers left with that work of art don&#8217;t understand its intended usage or how to make modifications.  From there, the engineers begin using it incorrectly and if they have questions they have nobody to ask and nowhere to look except for undocumented, increasingly morbid code.  Inevitably, the product starts its death-spin, the engineers blame the architect that left, and technical debt grows until the product declares bankruptcy.  At this point it&#8217;s time to rebuild or sink.</p>
<p>Truthfully, most of the fault really does fall on the architect.  The role of the architect is not only to code awesomeness, but also to understand the software circle of life and make wise decisions.</p>
<p>Don&#8217;t get me wrong&#8211;there is a time and place for rolling our own libraries.  If you come across this time and place, make sure you have the necessary resources behind it.  Do it right.  Where possible, create the libraries as though other companies might also use them.  Document them&#8211;not only in code but in API documents, examples, and tutorials.  Open-source them on <a href="https://github.com/" target="_blank">GitHub</a> and make it a home for external resources to congregate around and contribute.  Pay attention to others&#8217; contributions and incorporate their ideas and code where possible.  Many if not most of the great libraries available today originated from this concerted effort.</p>
<p>One last note about open-source libraries.  The historical perception is that these libraries are siloed away in some remote part of the web and their developers are anonymous and unapproachable.  This usually isn&#8217;t the case anymore&#8211;especially with GitHub.  Oftentimes if you have a legitimate concern the community is very approachable and will respond quickly and respectfully.  A great example of this is when I recently found that <a href="http://documentcloud.github.com/underscore/" target="_blank">underscore.js</a> lacked a function for finding the symmetric difference between multiple arrays.  I provided the underscore.js community an example of where it would be beneficial and <a href="https://github.com/documentcloud/underscore/pull/309#issuecomment-2852147" target="_blank">five days later it was added to the trunk with a unit test and documentation</a>.  Good libraries have good communities.  Choose wisely.</p>
<h3>We don&#8217;t need no stinkin&#8217; frameworks!</h3>
<p>A long-standing debate among some in the community is whether formal frameworks are needed at all.  The argument against frameworks usually goes something like, &#8220;We&#8217;re all smart engineers&#8211;we can architect an app well without having to resort to a formal framework.&#8221;  That may be true, but it&#8217;s usually a fallacy.  If it&#8217;s not a fallacy, it&#8217;s very difficult to do with most teams.  If you are able to successfully execute on that concept, you very likely unconsciously re-wrote large portions of a framework you could have used in the first place.</p>
<p>When working in a team, a framework provides an important benefit of consistency and a game plan.  Good frameworks generally prescribe examples of best-practice usage but provide some flexibility in implementation.  No doubt engineers can abuse the best of frameworks, but having a blueprint of how architecture and implementation should, in general, be performed goes a long way in getting everyone on the team to have a consistent vision and understanding.</p>
<h3>Learn JavaScript</h3>
<p>Learning JavaScript is not a one-time event.  You&#8217;ll be learning over a long period of time, but it&#8217;s important that you actually make it a priority to learn the language.  A lot of the libraries we&#8217;ll be looking at do a lot of abstracting for you&#8211;keeping you away from the nitty-gritty of JavaScript.  That&#8217;s very helpful and can speed up your development dramatically, but it should not be used as a crutch.  Far too often people learn libraries but not the language.  This is a mistake and will bite you in the end.</p>
<p>I&#8217;ll be the first to admit that JavaScript has some really nasty parts.  Frankly, it&#8217;s not my favorite language.  But you&#8217;ll be living in it.  Accept it and learn how to take advantage of its good parts and avoid its bad parts.  To that end, I recommend starting with Douglas Crockford&#8217;s <a href="http://www.amazon.com/JavaScript-Good-Parts-Douglas-Crockford/dp/0596517742" target="_blank">JavaScript: The Good Parts</a>.  Ironically, it&#8217;s a small book and very approachable by JavaScript noobs.</p>
<h3>IDE</h3>
<p>Get yourself a quality development environment.  If we&#8217;re talking web we&#8217;re primarily talking HTML, JavaScript, and CSS.  There are all kinds of free web-oriented IDEs (<a href="http://aptana.com" target="_blank">Aptana</a> comes to mind) but I recommend you pick up a copy of <a href="http://www.jetbrains.com/webstorm/" target="_blank">WebStorm</a> by <a href="http://www.jetbrains.com" target="_blank">JetBrains</a>.  A good IDE will give you great JavaScript code-hinting to shield you from some of the woes that come with the dynamically-typed language.  Other things I look for: coding workflow, local and remote debugging, version control integration, remote server deployment, plugins, etc.</p>
<p>Have comments or questions?  Post them below!</p>
]]></content:encoded>
			<wfw:commentRss>http://aaronhardy.com/javascript/javascript-architecture-the-basics/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<series:name><![CDATA[JavaScript Architecture]]></series:name>
	</item>
		<item>
		<title>Nimbus &#8211; MVC Framework Intro</title>
		<link>http://aaronhardy.com/flex/nimbus-mvc-framework-intro/</link>
		<comments>http://aaronhardy.com/flex/nimbus-mvc-framework-intro/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 22:51:45 +0000</pubDate>
		<dc:creator>Aaron Hardy</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[General Programming]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[macro]]></category>
		<category><![CDATA[model view controller]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[nimbus]]></category>
		<category><![CDATA[parallel]]></category>
		<category><![CDATA[redo]]></category>
		<category><![CDATA[sequence]]></category>
		<category><![CDATA[undo]]></category>

		<guid isPermaLink="false">http://aaronhardy.com/?p=221</guid>
		<description><![CDATA[UPDATE: Since the writing of this post, I&#8217;ve converted to and fully endorse Robotlegs as my MVC framework of choice. I invite you to check it out. For those who don&#8217;t know, Nimbus is a Flex MVC framework (or micro-architecture for the technically-inclined). Sponsored by Rain, we develop it primarily for use on our applications [...]]]></description>
			<content:encoded><![CDATA[<hr/>
<b>UPDATE: Since the writing of this post, I&#8217;ve converted to and fully endorse Robotlegs as my MVC framework of choice. I invite you to <a href="http://www.robotlegs.org" target="_blank">check it out</a>.</b></p>
<hr/>
<p>For those who don&#8217;t know, <a href="http://code.google.com/p/nimbus-as3" target="_blank">Nimbus</a> is a Flex MVC framework (or micro-architecture for the technically-inclined).  Sponsored by <a href="http://mediarain.com" target="_blank">Rain</a>, we develop it primarily for use on our applications but make it available for public use and encourage the community to <a href="http://code.google.com/p/nimbus-as3" target="_blank">contribute</a>.</p>
<p>Nimbus pulls core concepts from <a href="http://opensource.adobe.com/wiki/display/cairngorm/Cairngorm" target="_blank">Cairngorm</a> but is meant to cut out a lot of the plumbing developers groan about when they hear &#8220;Cairngorm.&#8221;  It&#8217;s light, but it&#8217;s not <a href="http://i260.photobucket.com/albums/ii22/shastymax/fluffy.jpg" target="_blank">fluffy</a>.  Baked in are those rare and tasty flavor morsels you thought only existed in those <a href="http://laparisiennecentre.com/blog/nfblog/wp-content/uploads/2007/07/confetticupcakes.JPG" target="_blank">Funfetti cupcakes</a> <a href="http://www.chaos.gwdg.de/~sinan/resimler/GRANDMA_KISS.GIF" target="_blank">your grandmother</a> bakes with love on your birthday.<span id="more-221"></span></p>
<p>Until the end of 2008, Nimbus had been shaped, re-shaped, patched, and plugged.  A complete re-write was merited so that&#8217;s what we did.  And really, what makes for a better Christmas than sitting down with your stocking stuffed with jelly beans and re-writing an MVC framework.  A few months later, the code is settling down along with the sugar and we&#8217;re ready for action.</p>
<p>Here are some features of Nimbus:</p>
<ul>
<li>Notification system of command completion so portions of the application can know when a command has finished executing.</li>
<li>Nestable &#8220;macro&#8221; commands.  Think &#8220;I want commands A and B to run in parallel, then C, then D and E in parallel, but inside D I want F and G to run sequentially&#8230;&#8221;</li>
<li>Undo/Redo functionality.</li>
<li>Progress feedback system.  You as a developer can associate a processing message with each command or macro command to provide feedback to users.</li>
<li>Interaction blocking system.  While commands are executing, easily disable user interaction to protect your service calls.</li>
<li>Combinable commands.  Ensure that similar command instances can be grouped appropriately in the undo/redo history.</li>
</ul>
<p><em><a href="/flex/the-best-flex-mvc-framework/">Nimbus may not be right for everyone</a>.  Call your system administrator if your scalability problem worsens or is not better within 7 to 10 days.  This may mean that there is another condition causing your RTE problems.  Do not take Nimbus with alcohol.  Call your system administrator right away if after taking Nimbus you are unable to walk, drive, eat, or engage in other activities.  In rare cases, severe allergic reactions can occur.  Most MVC frameworks carry some risk of dependency.  Do not use MVC frameworks for extended periods without first talking to your system administrator.  You are encouraged to report negative side effects of Nimbus.  Visit <a href="http://code.google.com/p/nimbus-as3" target="_blank">http://code.google.com/p/nimbus-as3</a> for more information.</p>
]]></content:encoded>
			<wfw:commentRss>http://aaronhardy.com/flex/nimbus-mvc-framework-intro/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The best Flex MVC framework</title>
		<link>http://aaronhardy.com/flex/the-best-flex-mvc-framework/</link>
		<comments>http://aaronhardy.com/flex/the-best-flex-mvc-framework/#comments</comments>
		<pubDate>Mon, 01 Sep 2008 02:26:32 +0000</pubDate>
		<dc:creator>Aaron Hardy</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[cairngorm]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[guasax]]></category>
		<category><![CDATA[mate]]></category>
		<category><![CDATA[model view controller]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[nimbus]]></category>
		<category><![CDATA[puremvc]]></category>

		<guid isPermaLink="false">http://aaronhardy.com/?p=68</guid>
		<description><![CDATA[UPDATE: Since the writing of this post, I&#8217;ve converted to and fully endorse Robotlegs as my MVC framework of choice. I invite you to check it out. Even so, the content of this post still remains relevant. There isn&#8217;t one.  At least not for everyone.  That&#8217;s the bottom line and hours of googling won&#8217;t change [...]]]></description>
			<content:encoded><![CDATA[<hr/>
<b>UPDATE: Since the writing of this post, I&#8217;ve converted to and fully endorse Robotlegs as my MVC framework of choice. I invite you to <a href="http://www.robotlegs.org" target="_blank">check it out</a>.  Even so, the content of this post still remains relevant.</b></p>
<hr/>
<p>There isn&#8217;t one.  At least not for everyone.  That&#8217;s the bottom line and hours of googling won&#8217;t change it.  I&#8217;ll explain what I mean&#8211;but first, here&#8217;s a real intro:</p>
<p><span id="more-68"></span></p>
<p>If you&#8217;re not acquainted with what MVC is and are interested in learning more, I&#8217;d recommend starting off with <a href="http://en.wikipedia.org/wiki/Model-view-controller" target="_blank">Wikipedia&#8217;s Model-view-controller entry</a>.   Simply put, MVC is a pattern of keeping portions of code where they belong, especially when it comes to code dealing with the model (data), view (user interface), and controller (operations/communication).  While MVC can simply be a development process or how a developer thinks while creating an application, communities of developers have often formed frameworks, or basic code structures, whereon a developer can base his/her code when creating an application.  They&#8217;re not always necessary, but many developers have favored frameworks because they <strong><em>help</em></strong> enforce good coding practices, eliminate &#8220;boiler-plate code&#8221; (repetitive code needed in each application), and create standards whereby developers can easily catch up to speed when joining a new, unfamiliar project.</p>
<p>With Flex, it seems there are more MVC architectures than there are developers.  There are plenty to choose from and their implementation can vary widely.  With so many frameworks, the inevitable question seems to always pop up: Which is the best one?  To truly find an answer, you have to consider who&#8217;s asking the question.</p>
<p>For a great illustration of this point, take a look at <a href="http://opensource.adobe.com/wiki/display/cairngorm/Cairngorm" target="_blank">Cairngorm</a>, the most widely-used Flex MVC framework.  It&#8217;s supported by Adobe so many developers naturally gravitate toward it.  It also uses, by most accounts, great programming principles.  By great principles I mean the ones you might learn in a programming theory computer science course.  And just as you might expect for feedback from students in a programming theory course, you can expect similar responses from developers who use Cairngorm.  Most of the time, such developers appreciate the fact that such a framework exists and that it promotes good coding principles.  However, if you ask them if they actually enjoy developing with Cairngorm, you&#8217;ll usually hear a an animate &#8220;no.&#8221;  Why?  Because theory does not always mean practicality or productivity.  This is even more true when dealing with projects of varying complexity, timeframe, maintenance, and team size.</p>
<p>The most often-heard complaint about Cairngorm is that it requires too much code duplication.  For most development teams (including my own,) this is certainly true.  The various layers, from the Cairngorm events, to the controller, to the commands, to the delegate, require a lot of code duplication for little gain&#8230;<em>for us</em>.  For those with large systems, heterogenous backend services, high employee turnover, long-term maintenance, or other such attributes (what Adobe consultants might be dealing with,) such a framework may be exactly the ticket.  When it comes down to it, your choice of MVC framework should come down to what drives <em>your</em> bottom line, not what others consider to be good theory or what works for them.</p>
<p>Because of this disparity in needs vs. fulfillment, each MVC framework is going to have a bucketload of both good reviews and bad reviews.  Some frameworks may be better than others at solving problems for the greatest number of developers.  In such a case, ask yourself if a good generic solution is really better than a not-as-good customized solution.  What may be &#8220;not-as-good&#8221; for others may be exactly what you need.</p>
<p>Many other questions can help pinpoint what you&#8217;re really looking for in a framework.  Does one framework have a strong following that will fix bugs and implement functionality when needed?  How much is this development community worth?  Is the framework too heavy for your application&#8217;s simple needs?  Can your application really take advantage of a large number of code layers or does it make sense to cut out the plumbing?  How difficult will it be for new hires to grasp the application&#8217;s architecture?  Are you handing the application off to a team that&#8217;s acquainted with a specific framework?  Are your developers skilled enough to recognize when they&#8217;re writing spaghetti code or do they need strong guidance and tight restrictions from the get-go?</p>
<p>To sum up and repeat what I&#8217;ve said before, there is no <em>best </em>Flex MVC framework.  First determine what your development team really needs and then find the framework that best fulfills those needs.</p>
<p>So you may be wondering what my team over at <a href="http://www.mediarain.com/" target="_blank">Rain</a> chose for our MVC needs.  After researching and evaluating Cairngorm, PureMVC, Mate, Guasax, and Fake, amongst others, we decided to go with a solution built in-house and customized for <em>our </em>needs.  It&#8217;s based off Cairngorm with a couple layers cut out as well as a few features tossed in (such as undoable commands.)  Good luck on your quest to find &#8220;the best&#8221; Flex MVC framework!</p>
]]></content:encoded>
			<wfw:commentRss>http://aaronhardy.com/flex/the-best-flex-mvc-framework/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

