Below, I describe my experiences with Ext JS after the Sencha Fast Track training, my challenges with doing browser based work in a consulting context, and my thoughts on why it matters to Flex Developers.
Get comfortable, this is long.
I had the pleasure of attending a 5 day fast track for Sencha’s Ext JS 4 in New York last week with my partners from Web App Solution. Of the 13 people that attended, 7 were Flex Developers working on Enterprise Applications. Yakov and Victor from Farata Systems were there and Universal Mind had John Yanarella representing.
While the technical future of Flex is extremely bright and exciting, the business and marketing future of it is over. Adobe, with the community’s help, has ensured that it is in the best hands with the Apache foundation. With a multitude of capable, brilliant, and diverse contributors to the open source project, there are definitely a lot of great things on the horizon for the next Flex SDK.
Adobe has also ensured, intentionally and unintentionally, it has a limited future which will ensure Flex is no longer invested in any technical capacity from small, medium, and large businesses unless absolutely essential, or under the radar. The mobile revolution has happened, and while Flash had the opportunity to play a pivotal role, Macromedia, and later Adobe have failed to take the initiative and successfully execute on it.
While there is still a significant business & technical advantage from a design, development, and workflow perspective in the Adobe AIR stack for developing & deploying on Android and iOS, Adobe has made it a clear that they perceive it is an opportunity they are not interested in pursuing on the developer front. This is a huge topic mostly discussed from a technical perspective in the community, and only a select few blog articles got it right from a business one… and even then, those missed it from a technical perspective.
Bottom line, Flex Developers are between a rock and a hard place in the industry right now.
The type of work they do for desktop web applications is different from what Flash Developers do, mainly in team size, project scope, and client base. It’s not as simple as “just use jQuery, and move on”. While the tools & runtime we use are technically sound, even clients who have a technical understanding of the marketplace & toolset will not invest in a perceived abandoned platform. Server-side offerings do not offer the rich client experiences we’re used to creating. The plethora of frameworks in the web market, both open source and proprietary, do not offer the same tooling, performance, and expedient workflow we have on the Flash Platform.
… except Ext JS. Sort of.
As stated by John Yanarella at the training last week:
“Out of all of the web based frameworks out there, Sencha’s Ext JS is the best safety net there is for Flex Developers.”
It has the necessary component framework, a growing company with enough resources & funding at a specific size behind it, with a competent web & mobile technical story that has the potential for critical mass within an Enterprise context.
Thus, given my company’s need to offer my clients an HTML5 alternative to Flex, Ext JS seems to fit the bill. Considering time is at a premium nowadays, the fast track training Sencha offers seemed like a great opportunity. And I love New York so any excuse to go there is great.
Given the whirlwind that was the past 3 months, as well as reflecting upon what I learned from the training, I thought it prudent to write down my thoughts here. There are a lot of Flex Developers who are looking for direction, so I’m hoping this is one for them to follow.
As a Flex Developer faced with a forced career change driven by forces beyond my control based on the infamous events of November 9th, 2011, I had 2 choices. Do what I always did back in my 20′s and dive headlong into the unknown, or let the pioneers get the arrows in their backs as it were. Now that I run a business and am a father of 2 children, I don’t have the free time I used to back being single and W2. Flash & Flex, even on death march projects, allowed me to get up in the morning fueled by the passion of using my favorite technology, and attack problems full bore.
Surveying the landscape, things were pretty grim… even for someone positive like me.
While the iOS stack had a clear advantage with both a growing developer base, mature tooling & framework, and customers who actually paid for content, none of my large clients actually had initiatives around iOS work. Enterprise applications, known for their copious amounts of input needs from the user, do not translate well to the small screen size and lack of keyboards on smart phones and tablets.
As such, while the uptick in service based software shops servicing the needs of clients who need iOS applications has increased, the scope of said projects is not as large and often is more consumer based. The latter is troubling as it’s hard enough utilizing ActionScript 1 in a deadline driven environment that Design Agencies employ; dodging technical debt for as long as possible in Objective C, even with superior tooling is not appealing when longer and more profitable projects exist with the opportunity to have competent peers beside me vs. being a lone wolf. Learning a lower-level toolset for shorter engagements that pay less makes it a non-starter.
Android, while being easier to deploy to as well as more easily iterating with your customer base, is notorious for it’s fragmentation, both programming and design. It’s hard enough for designers to lessen the overall experience via responsive web design to compensate for a variety of screen sizes. You now have developers who cannot turn as fast as designers can and thus have to spend more time on a platform that doesn’t generate nearly as much, if any, revenue from consumers compared to iOS. This doesn’t even broach the business topic of how do you lessen the maintenance cost on your customer when they have to hire both an iOS and Android developer, or some awesomely expensive hybrid who can do both, to handle both platforms. The other bizarre thing about Android is that it is taking the PC approach to competing on price with iOS and continually increasing market share, yet doesn’t seem to be generating the service revenue compared to iOS (ie people who own Androids don’t buy apps as much as those on iOS). Same problem as iOS: Invest in a lower-level technology with massive fragmentation for shorter projects that pay less money… again, non-starter.
The multi-development & deployment problem was what the web was supposed to solve. While native development does give you significant user experience & tooling advantages, it seems wrong to invest my career for applications that my current client base do not target. Every single large client I’ve had treats mobile as either a fun skunkworks project, experiment with no perceived ROI, or as a necessity with the minimal amount of money devoted to it, sometimes taken from another project’s budget ad hominem.
Both don’t bode well for a future career from a consulting perspective in mobile.
While consumers bringing their smartphones, tablets, and technology of choice to work has had a huge impact on large companies, most Enterprise customers still target the desktop web as the main avenue of both B2C & B2B based revenue. While many have made huge and wonderful strides in providing value for their mobile websites, it’s clear many either provide a lot less functionality than their desktop counterparts, or strain at even that.
With large media companies it’s a little different. Studies have shown that tablets are better at allowing consumers to consume content whereas desktops/laptops are better for producing content. While “duh”, having studies like this made and corroborating themselves verifies what we already know. They have a vested interest in increasing consumers ability to purchase and access that content in a controlled manner.
The problem here is that the budgets for those projects doesn’t increase with the needed targets.
For example, while working on HBOGO.com, the initial release of the iPhone app did not allow you to watch videos. The Flex app we did at the time was the only way to view videos. Overtime, it was prudent to support both iPhone and iPad versions. A lot of companies, however, don’t magically get 2 budgets, 1 for the web and 1 for the iPad just because the iPad is so cool. While the GUI’s needed for iPhone and iPad are simpler, you still want to create the same user experience for the customer, especially if they are using all 3 to access their content. The Iron Triangle verifies that something must give, and thus, the scope/functionality/user experience often does.
Investing in a mobile technology where consumers pay less, and larger businesses devote less capital to the same projects doesn’t bode well for investing the smaller portion. If I were back in 2002 still doing design agency work, I’d totally be an iOS developer right now. As a consultant who does more than build software, and who doesn’t see his clients changing their plans, I see no prudent reason to go the iOS/Android device route. …… beyond them being really fun (another story).
Appcelerator, Corona SDK, Sencha Touch, and PhoneGap, technologies which allow you to deploy to multiple mobile platforms with mostly the same code base and skillset, can be lumped in the same bag as native with the above perspective.
Why invest in technologies that offer less money and my clientelle isn’t using?
The Challenges of the New Platform
The issue, however, is that it’s not that straightforward. There are 5 main issues that the HTML/JS/CSS stack (which I’ll here after refer to as the HTML stack), have when coming from the Flex platform in a consulting context (there are more, but these are the ones that matter with regards to the context of this post). They are:
- DOM as a dynamic display technology
- There are larger problems for multiple Browser Vendors to solve
- the industry’s libraries & frameworks are young from an Enterprise context (yet not!?)
- The Video Codec Issues
The Document Object Model
The HTML DOM wasn’t made to do the type of applications we do in Flash, more specifically Flex. Flash Player was developed specifically around cross platform visual fidelity with a web bent. More importantly, though, it was built around redraw. This perspective of “frames per second”, and continual improvements around the underlying timing of redraw, building upon what a platform does well, and then abandoning a “new” 5 year old display technology to support a GPU future.
Browser vendors are doing some pretty amazing things with the DOM, from hardware accelerating the display, continuous redraw optimizations, all the while doing their best to follow ever evolving standards amongst our changing technological landscape. …based on a tech designed and created to show text. That’s awesome.
Sadly, the redraw performance isn’t awesome. While a lot of Flash and Flex developers never really got the purpose and value of invalidation in Flash Player, even with a technology created for displaying and animating composited graphics, as your application scales, it’s easy to create a system that redraws too much. Invalidation helps mitigate (usually solve) that problem for 90% of the use cases in applications. In a nutshell, it means you can set properties on your visual components as much as you want to in a single thread and ensure it only actually redraws the screen 1 time.
For browser DOM’s, this is exemplified even with the drastic CSS improvements. The philosophy is to never redraw the DOM if you have to, and if you do, do so on the smallest section possible. Browser toolkits such as Ext JS, Dojo, and some others do this very well. While they have the advantage of browser CSS to help mitigate some of the redraw performance drags, compensating for both past, current, and future browser incompatibility in an easy to use & scalable API shows just how brilliant some of those browser developers really are. Based on what I’ve continued to read, this seems to be getting better although not as fast, nor as widely deployed, as Flash Player did which means the problem isn’t going away soon and thus the need for x-browser, x-platform invalidation continues to be important. Thus, Ext JS’ commitment to efficiently redraw the DOM is appealing.
One thing John brought up at the Ext JS Fast Track training last week was the lack of positive sales around hybrid solutions: using Flash Player and the HTML stack together. If you need to play video or animate/show a lot of composited objects, combining the 2 technologies together.
Hulu and YouTube proved it can work with video and movie subscriptions. Grooveshark proved it can work with music (and video, heh). Google Finance and Analytics proved it can be done with charting. Balsamiq proved it can be done with desktop designer tooling.
Bottom line, things are pretty bad but getting better slowly, and there are mitigation paths that can utilize Flash Player in the interim. Canvas is finally getting hardware acceleration across platforms also making it another another tool to help.
This doesn’t seem to be getting much play, but considering we’re all supposed to magically know a multitude of platforms, languages, and yet have multi-talented sub-contractors that meet that criteria and deliver the projects in the same time frame clearly means that option is also on the magical table.
While it made sense for server-side developers to reduce their code size as more logic goes to the client and their servers get faster and cheaper, we’re still a little confused as why the industry isn’t salivating for a statically typed Harmony (resurrected, non-elven remains of ECMA 4).
Furthermore, if you didn’t provide source, the developer was screwed because there was no way to easily introspect API’s unless you read the documentation or source; things like Aptana didn’t exist back then. This also implied, however, that even though there were things that weren’t public, developers would still call them anyway if they didn’t understand your name spacing convention (such as using an underscore (_) prefix for private variables and method names). While Lua and other languages have tricks using closures to emulate access modifiers, this never caught on in the early Flash world. The path for RIA’s at the time was larger projects with larger teams, and thus they adopted a more Java esque method of language development while still trying to match ECMA 4 as best they could.
Thus, the natural evolution was for a strongly-typed language with proper packages and namespaces (or access modifiers like public/private) to help us address the larger applications we were developing. It did. It was, and is, awesome.
…for some. About the same time as I started getting more consulting, I also started noticing a larger awareness to the different types of businesses using Flash and Flex. In the Design Agency world, the majority of the work was 2 months to 2 days, and in between. The teams were often 1 developer; if there were more devs, they both weren’t on the project the whole 2 man months. They hardly ever payed their technical debt (unless you were a consultant with them). You started to see a strange love/hate relationship for a lot of these devs. In some cases ActionScript 3 helped these developers, who were on a deadline and often never paid their technical debt, manage said technical debt with AS3′s improved strong-typing and runtime exceptions with the ability to use loosely typed constructs when needed or in unknown territory.
On the flip side in the Flex world for larger companies that gave a flip about design, and more about feature count, the language constructs were barely enough. Constantly we’d get barraged from developers in more low-level languages like Java, C#, and C++ about why is AS3 is missing this or that (true Singletons, true Abstract classes, threads, blah blah blah), and how do you emulate such features.
It was very clear there was a split was growing. I could elaborate on all the niceties, but suffice to say, the Flash Devs didn’t need all the language features & strict complexity rules whereas the Flex Devs couldn’t get enough. Again, a simplification on the nuances of a thriving, diverse, and changing community, but accurate.
While I like Keith’s take and respect his opinion, not having classes and encapsulation won’t work in large teams, often setup to fail at the outset by politics, nor all being Keith Peter’s caliber (me included). The other option to “not working” of course (Goonies never say die), which I’ll cover later, is that it’ll just take longer and/or we’ll accomplish less. The rules of Mythical Man Month, Technical Debt, etc. still apply regardless of language/platform. It’s worse in Consulting when coding software, extremely hard in it’s own right, is the least of your problems.
While the reaction was very positive around the work Adobe was doing with FalconJS for those in attendance at the FlexSummit, it was very clear to me it was a science experiment with no hope in providing the needed migration path for Enterprises. The amount of work, resources, and time needed to bring it to Oracle ADF, Google GWT, or .NET caliber is clearly something Adobe didn’t seem willing to devote. That, combined with their clear direction of no longer focusing on developers.
Google Dart seemed like a light at the end of the tunnel. It, too, however, seems to be a science experiment of Google scale. It has all the hallmarks for a bright new project:
- Google is behind the engineering effort
- has 2 compilers: 1 a Flex Developer would use (dartc) and 1 a Flash Developer would use (frog).
- is based on Eclipse (good and bad, let’s just pretend the good parts here)
- brought on Alex Russell of Dojo fame to take a fresh look at the DOM event API
- Cliff Hall of PureMVC fame (multi-language framework used a lot in Flex) made a first version port for Dart.
…yet doesn’t seem a priority since while a web based technology, it still hasn’t reached critical mass, nor does it show any signs of doing so yet. I’m more concerned about the amount of resources I’m seeing being devoted; maybe there are more, and like all things Google, they just don’t advertise it. I really wish I could just parachute drop a Porter & Bogusky contingent in Google someday…
The other problem is that you need everyone in your organization coding the same language. In product companies, it is TOTALLY fine to have a technology du jour with Ruby running your builds, PHP running your render farm, and Java running your back-end, but for development purposes on 1 particular platform, you standardize on a language and usually have company ordained standards on it. This is for maintenance costs, and hiring standards, and a variety of other reasons that aren’t just around cost.
If anyone has CoffeeScript running atop Ext JS, let me know how you got your build process setup.
What do you today?
Fine, no big deal, you just move forward using an Object hash approach. We’ll just wait a couple of projects before maps + Dictionaries catch on in all browsers.
…but what about Web Worker (also known as threads for web developers)? It’s only supported in IE9 while Firefox/Safari/Chrome are good to go. While you can emulate via green threading, this is a FAR cry from emulating the lack of getter/setters in older versions of IE, or even emulating Canvas for Internet Explorer 8 via a VML wrapper. Those work. Green threading is not the same thing as a separate process that ensures it doesn’t lock up your GUI thread. The lack of full browser support will prevent some features from actually working and there aren’t any fall backs that can be utilized.
For some charting/plotting applications, these are essential features: no web worker, no application. Now in Flash, you’d just plan around upcoming features, both those you voted to be actual features, or those you knew were coming down the pipe. One tactic of design agencies, and Macromedia/Adobe in general was to have them launch a high profile app/site/widget to showcase these features upon launch.
- identify a problem you had on projects
- bring it to your peers & Macromedia’s attention
- rally support through email list/blog/twitter posts/talking to company reps at conferences
- make writing & validating the use case easy
- get community votes when desperate
- await new feature(s) in upcoming Flash Player, beta test if lucky
While this process for Chrome seems EXTREMELY quicker, for the rest of the browser market as a whole, including smart phones and tablets, not so.
My college professor said, “There will always be work to be done.” Unless we use hybrid implementations, clients will just have to live with the slower pace of innovation if they want broad adoption. I guess I’ll live, I’m just curious where my excitement will come from if the toys remain the same, or only 1 browser implements a new feature I can’t easily abstract. That, and it seems a lot of innovative projects will either start to be browser specific feature branches, or just wait for broader adoption amongst modern browsers. It’s sad. And frustrating for both my clients and my team.
Wild West: Libraries and Frameworks
In the Flash World, there were 2 frameworks that people would use, if ever: ARP and… just kidding, 1. While the tweening libraries got a little out of control, and the component frameworks became pretty niche, overall there was a library for everything, sometimes with an alternative if you didn’t like one particular implementation. A lot were ported from other languages, like Java and C/C++.
Frameworks didn’t really start to rear their head until Flash RIA applications started to become mainstream, and Flex was born. The Java developers coming over didn’t see any common MVC/MVP/MVVM frameworks that allowed them to manage copious amounts of code on the client side vs. middle tier. Cairngorm, PureMVC, Swiz, Parsely, and Robotlegs were born. Cairngorm is still around, but Swiz/Parsely get most of the play in the Flex world with PureMVC and Robotlegs hitting both Flash and Flex.
With exclusion of Cairngorm, all 3 have a lot in common. While everyone somehow manages to make their own implementation, learning one helps in learning another. Additionally, most never made it past a version 2, and even then most of the changes weren’t a dramatic workflow change.
I. Do. Not. Want… to be a non-Enterprise TA right now. Holy fish. Like, it’s 2008: “Yes, we’re using YUI version 2, it’s rad, has a large company backing it, and we can hire for it.” It’s 2012, and you’re either a jQuery, Sencha, or Dojo kid… oy vey.
So far, with the exception of Ext JS’s MVC implementation, it seems to have all of that solved in version 4 as best it can with the ability to have your own libraries added in with your own modified build process over theirs as well if you see fit to do so.
No one has solved the codec problem yet. This is where HTML5 video just doesn’t work as advertised. I won’t go too much into this topic as for Enterprises, you’re usually more concerned about VOD, DRM, multicast and live streaming which Flash owns for desktop and HLS owns on iOS. More info about the WTF here and the OMG here.
I only bring it up because it’s just accepted in our world that video and compositing of it + assets is expected in our content, yet now… it’s not. Good designers can make it work, but the point here is from an integration perspective the cost of integrating that content.
Lastly is tooling. While Aptana makes an attempt, it seems that Microsoft’s Visual Studio is the only IDE that seems to take web development seriously for those building large applications. Since me and a lot of people I know in Flex development use Mac’s, it seems our only alternative is JetBrain’s WebStorm. Granted, they have other flavors of their IntelliJ IDE, but without commonly expected functionality like code hinting, intelli-sense, and re-factoring, it’s hard for use to take web development seriously.
There is a huge productivity cost that people seem to forget when you move from Eclipse/IntelliJ with those features to Notepad. When you have multiple developers, that time spent adds up, as does the lack of accuracy on your team’s velocity in solving issues.
In 2004, a lot of Java Developers tried out Flash. They then left. Adobe then created Flex. Some came. When Flex 2 came out, the runtime worked, the language worked, the components worked, but more importantly, the Eclipse IDE at the time… worked. The refactoring was, and still is not the best compared to IntelliJ and Visual Studio, but it’s enough for them to take it seriously. That’s when they came en masse, and peeps like Bruce Eckel were like, “Flex is good stuff”.
Going into an Enterprise and telling developers they are no longer allowed to work on Enterprise software with intelli-sense and code hinting isn’t going to work. Thankfully Ext JS is working with a few tools vendors, and some, like WebStorm, can be customized to improve the hints you get, including on your own code.
At the end of the day, we Flex Developers are concerned about the overall reduced project velocity & resolution prediction that comes with losing static typing (“What and where is the problem and when is it going to be resolved?”). For smaller projects with smaller teams, I guarantee you the point is moot. In doing both, if you CAN do both, dynamic languages are so much faster and fun to develop quickly, and flexibly in. For 18 month, multi-developer teams on code that’s alive for 5 years, it doesn’t.
As a business owner, we have to meet the needs of those clients that have adopted the HTML Stack, or feel they need to and cannot be convinced otherwise. In the following article I’ll cover what Ext JS is from a Flex Developer’s perspective, why you should care, and some conclusions on how using it + Flex changes our business for the better.
As I mentioned before, the events of November 9th, 2011 shook the Flash & Flex world to the core, and I had 2 choices: figure out where to go, or let other key members of the community figure it out.
I chose the latter plan: play Skyrim and disappear for 3 months to let it all shake out. If things hadn’t been figured out by key members of the community, I’d just figure them out for myself. It’d also be around the same time as Groundhog Day: If the Flex community saw their shadow, and freaked out, I could come out and help them weather the longer winter.
It’s been 3 months and so far, it seems all the Flash Devs went jQuery/Backbone (or Angular) whilst the Flex Devs are debating between Dojo and Ext JS (pronounced “X Jay S” if you’re French Canadian) (yes, I tried YUI and left just as quickly). After talking with members of the community and doing some of my own research, it seems Ext JS is the right choice for the type of work I do. Like using Flash vs. Flex, it’s clear it may not be the right choice for you. If you’re a Flex Dev doing large, multi-developer projects, I’ll bet it IS the right choice. Read on.
What is Ext JS?
It’s attractive to Flex Developers because:
- It has components. Lots of components.
- It has styling and theming features.
- It has a Model architecture built around data store & server CRUD operations.
- It has charting components that do not utilize Flash Player (for good and ill)
- It has awesome item renderers for grids.
- Layouts with Containers
- Standard Focus Manager
- A big company, with investment, and tons of docs who’ve adopted a prescriptive MVC framework.
There’s a lot more, but that is what we Flex devs actually care about.
How’s it work?
Prescription & 3rd Party Integration
Sencha has to walk a fine line with Ext. From an Enterprise stand point, they have to lay the ground work for a prescriptive way to utilize their technology. You need to make a framework easy to work with, have good documentation, and not be too flexible that developers can all go their own way. This allows larger organizations to hire/cross-train easier, have those developers actually be successful with minimal investment, and basically ensure any skillset “knows how to build an app”.
It’s a sales pitch, yes, but it does need to try to work like that. In reality it never does, hence consultants like me existing, but that’s not the point. You don’t want many different ways to skin a cat from an architecture perspective. It’s fine if you cuddle your brackets, use TextMate to code, and prefer Mercury over Git… it’s not fine if you prefer MVVM over MVC, want to be intimate with the DOM, and the other developers in another part of the company on a companion product don’t. Unlike Design Agencies, Enterprise companies do have to pay their Technical Debt. In fact, I’d argue they pay more than they should, compensating in a bizarre karma like way for Design Agencies who get away it. You want to mitigate this problem by making something easy to use, easy to hack, but prescriptive enough that if you don’t know any better, you won’t cause undue costs down the line in the way your team built something.
Sencha needs to support prescribed direction in how you build web applications with the ability to support 3rd party libraries.
There are a few things they’ve done to facilitate this. Here are a few that matter.
First, they’ve abandoned Object.prototype as of Ext JS 4. If you’re a Flash Developer, you’ll remember having your language suddenly act different because some developer or 3rd party library overwrote a core property/method in Flash, and suddenly your entire application worked differently… or it only did it sometimes because of later loaded class. Unless you knew what you were doing, these were nearly impossible to debug since the documentation stated a method did one thing, but clearly during testing did another. Even if you did know what you were doing, there aren’t many language, nor tooling facilities to help you debug this inheritance mixin whackness.
Also, from a module perspective (those of you using PureMVC multi-core or many Robotlegs Contexts will get this), you need to sometimes run may applications in parallel on the same page. Not having to worry about stomping on someone’s method/properties is a nice feeling to have.
Second, they’ve commited to bootstrap.js their own bootstrap.js from a library/module perspective which supports both debug and production mode. With the build process, this allows you to develop with new classes on the fly, and in production mode actually have 1 file for you’re entire application. This is for speed & ease of development purposes.
We take this for granted in Flash/Flex where all our classes are included, and zlib compressed in a minified bytecode format into a single SWF file.
Third, their MVC is prescriptive. I won’t get into too much detail because as a Swiz/Robotlegs aficionado and PassiveView h8tr, I already want to use my own or Angular… anything but theirs. That doesn’t matter, though, the point here is that they’ve provided the built in mechnisms, it works great with the framework, and they have documentation on it as such. This ensures organizations take them more seriously, have a chance to at least be forced into some known structure, and you as a consultant have a chance of understanding how they did things if you come onto an existing project (assuming they didn’t just use Ext JS for it’s query syntax and get all intimate with the DOM… which you can do if you wish).
That’s Great, Show Code
Here is some Hello World code:
As you can see right off the bat, closures are the word of the day. Ext JS is full of either closures (anonymous functions or variables that equal functions) and/or JSON. You’ll intermingle both a lot.
Components are the main reason most Flex Developers dig Ext. Not only are there are a lot of components, but some of the ones they have are better than their Flex equivalents. And this, folks, is one of the reasons why software developers often tell you to try another language or platform, at least 1 per year. You’ll see what the competition has, and YOU’LL GET PISSED OFF!
Why didn’t Adobe build this level of components for Flex? Why does Django, Rails, Coccoa, and countless other frameworks have a Model with optional Facade on top to support offline storage with online CRUD syncing out of the box… and Flex does not? How come our DataGrid didn’t come with built-in paging?
Enough ranting, check them out yourself (scroll down, check out list on bottom left) while I cover a few here.
T3h Über Grid
You’ll notice right off the bat their DataGrid is pretty bad ass. Three things I want to point out about it.
Notice they have paging built-in. This is, in part, to their Model/Proxy/Store setup. In Flex, you had to code this yourself (don’t get me started on Blaze DS/LiveCycle).
Notice their filtering actually has a GUI with a drop down menu to customize (and which YOU can customize) on how to filter the data. No server trip needed. Hot.
And finally… “row editing”. Yes, an entire row can be modified. You can also allow a row to be edited, but only allow certain columns in that row to be edited, as well as customize this renderer. Awesome, right?
Charts, like Grids, play a central role in a lot of financial & insurance software. You see the data in lists and you visualize it in charts. Ext JS 3 used Flash, but now they use SVG (and I think VML in some cases) and no canvas. This ensures it’ll work without a plugin. The downside is you can’t print yet. They’re working on it, and there are a lot of server-side plugins where you can easily wire up the chart data to a button to have the server assemble a PNG or PDF for you to print so solutions do exist.
You’ll notice, too, that they are interactive. You can customize a lot of their display + tooltips I believe to degree using templates (I’ll go over that later). They also have the standard animation built in as well. From a sales perspective, these charts + the grids demo very well.
Everything else is what you’d expect your team would need from Tabs to layouts to forms. The layouts are a little tricky if you’re not a CSS/DOM savant, but again, they abstract a lot of that from you (including that weird IE vs. the rest of the world padding measurement insanity).
There are a lot of little innuendo features too that make a big overall difference like all windows having the capability of being resized with a resizer, from all sides.
The components all have the standard DOM interaction events usually abstracted away so you just add an event handler for it, and you can create your own as well.
Yes, they have drag and drop.
Yes, they have a variety of ways to handle state, both in components and within your application itself.
Their drawing package uses SVG I think… not really sure why they aren’t using Canvas, but I’m sure they have their reasons.
Localization & Accessibility
They have localization and accessibility built in. I had some concerns during the fast track course because it seems the localization requires the application to be totally reloaded just to have text changes take effect. Meaning, there aren’t default framework bindings to a resource manager like you do in Java or Flex.
Either this was a bug or we couldn’t figure it out, but bottom line the components built into Ext JS do work with it, and you can see their text match the language; we just couldn’t get this to work at runtime, only compile time which is fine.
Just a quick note on the event model. In Flash Player, we have the standard ECMA event model in terms of capture, target, and bubble phase. Since IE is backwards from the rest of the world and is in the minority camp, Ext JS flips it around and gives you their own Event class as well.
They key difference, however, is that interaction burdens are put on developer, much like Corona SDK does in Lua. If you want to handle an event, you need to return true to ensure it doesn’t bubble up and get run. I’ve seen other frameworks which just code gen the event.stopImmediatePropagation() and event.preventDefault(), but not here… and sometimes you need to return true from event handlers vs. calling the event methods. I haven’t figured out yet where the consistency is.
Anyway, a small thing, but good that they abstract the browser differences for you and provide a common event class + mechanism for you. The addEventListener and/or callback way of doing things will be extremely familiar. I believe they have an event bus, but it’s not like Robotleg’s Actor or PureMVC’s Notification system.
Styling & Theming
If you know CSS, you know how to style and theme a Ext JS application. Yes, that’s it. I unfortunately didn’t get to see, nor play with, a lot of the skinning in the Fast Track, just styling. I’m not sure how much of the image issues in various browser they abstract away since you’re using your own CSS styles.
Ext provides some template theme CSS files for you that you can modify, both built in classes as well as Ext JS ones. Combined with SASS/Compass, this really makes things a lot easier to handle. If you’re not familiar with SASS, there are just 4 things you need to know:
- You write 1 CSS style, and it’ll generate the browser/vendor specific ones if any (1 line of SASS could be 3 lines of CSS)
- You can utilize variables in your SASS code which helps dynamically create the appropriate CSS (like determining width/height on the fly, etc).
- They actually treat it like css CLASSES… so all the inheritance feels like inheritance vs. some “I’m not really code, but I’ll pretend I know what OOP is”
- SASS files get generated through Ruby’s Compass into CSS files for your project. You don’t write CSS; you write SASS and Ruby’ll regen the CSS for you.
Models, Proxies, and Stores
Most Flash and Flex projects I’ve worked on have some form of Value Objects (classes that hold data that represent a server-side entity with additional data the client needs), Models or Proxy classes that allow the client retain data and state, and service classes that form the basis of the CRUD operations with the server.
In branching out into other languages/frameworks/platforms, it’s clear most have a large sub-system and abstraction layer upon this setup. Django has Model, Rails has ActiveRecord (or did… been awhile), Coccoa has CoreData (amongst other things), and Java has all sorts of things. Even with the large influx of Java, Flex never really got that kind of abstraction unless you went with the full Blaze DS / LiveCycle stack. It was abstracted away enough that you could build both non-Blaze/non-LC apps and not know the difference, but the point is that it was clear Adobe didn’t think that was a core part of most apps, or rather that particular part could be monetized in Enterprise only offerings.
Whatever the reasons, it’s a core need in a lot of applications nowadays. I need to persist data in RAM, on the client cache (whether SQL or cookies), and with the server. Using a Facade or Proxy to make this part not only easier, but allow client side validation, as well as being built into all components, is a huge win.
All you need to know is it’s like an ArrayCollection that can save both locally to disk as well as sync with the back end as well as work as a dataProvider to all your components. And yes, when the dataProvider updates, Ext JS will update your GUI controls. Yup.
Sencha has specific meanings in the Ext world between Model, Proxy, and Store so don’t necessarely think design pattern as each is completely different than the other.
They support inheritance and package names for your components. Although I’ve never done Ext JS 3, it’s clear they are constantly improving because the syntax in 3 was nasty compared to 4.
I’m still learning about the world that is HTML Templates but suffice to say there are 2 main uses in Ext JS.
The first is custom components. Creating custom components in Ext JS is pretty straightforward; you just extend Component or Container, similar to Flex. However, they’re creating the DOM for you. What if you want to create your own HTML elements based on some strange PSD/AI design comp the company Crayon Pusher sent you? You can create your own HTML and have the data actually bound into it through a similar binding syntax we’re used to.
The second is item renderers. Any type of list, whether a small Container, or an actual component within a DataGrid itemRenderer can use a template. This allows quick creation of an itemRenderer without having to write a lot of code if you want to. Pretty sick.
MVC, MVP, MVVM, Your Mom
I’m not going to go into their MVC too much. Suffice to say, they like the Passive View and have no qualms with a Controller managing multiple Views (at least, that’s what the Fast Track implied, but they don’t have time in those types of courses to show you all avenues). Worse, their naming scheme assumes you have a flat file structure, so you don’t name something “MyModel”, just “My” because they’ll append a name to it anyway causing it to be MyModelModel. That, and I fail to see how a flat directory structure of model, view, controller will scale to an application of any reasonable size, even with Ext ability to use string namespace aliases to refer to your classes.
Keep in mind the instructor was only given 1 day to show 1 way to do MVC, and we didn’t get too much time to dive hard core into the internals. It was clear, though, none of us liked it, and already Flex 1 era framework ideas were churning to bring our ideas (and biases) to Ext JS.
- They have horrible naming conventions for optimization purposes that no longer matter in todays world.
The naming conventions are bourne of an era no one should care about but they still do. We’re in a gray transition as browser makers bring the HTML Stack up to speed to build applications, so you can’t just full stop ignore all the lessons learned.
However, I’d argue, as would countless others, that code readability trumps performance concerns. This goes way beyond “premature optimization is the root of all evil”. On extremely large code bases, verbosity is a virtue. You want readable code that it is easy to understand, both for your team and for yourself.
- Readable code trumps performant code.
- If this is such a concern, why are we using this over Flex again?
More importantly, however, is for API development. API’s are given to people who you sometimes have no contact with, nor have any clue about their adeptness. Thus, you need to make it as easy and obvious as possible. For an Enterprise framework such as Ext JS, you’d think this would be top priority. It’s clear Ext JS has some highly experience web developers involved in developing the API. I respect their knowledge, but it’s time to change.
Examples include Ext.getCmp vs. Ext.getComponent, Ext.getEl vs. Ext.getElement, and baseCls vs. baseClass. It’s prevalent throughout the framework, and mixed in with good verbosity… which makes it worse.
While Ext Designer completely blows away Adobe Catalyst, it still has some issues with regards to the code generated and code round trip/merging. While looking nice, the results are not always being correct. We had easily duplicatable issues where the code generated did not match what was in the IDE GUI. Still, an extremely useful tool for generating a lot of the needed visual component code.
Finally, the lack of out the box code IDE is a near deal killer, at least for strict TA’s we deal with at large organizations. I know Ted said they’re working on it. Without things like intellisense and code hinting, you’ll make it hard for people to take things seriously, as well as making it harder to learn for more traditional programmers who suddenly have none of their mature toolset available… like… Java Developers… who came to Flash… and left… and… then they created Flex Builder…
It seems Sencha has all the hallmarks for success and reaching critical mass with Ext JS. This is the ONLY reason I and others have given them any attention. As previously mentioned, you need a mid-size company, with money, and a good product to have it adopted as a targetable platform for large organizations. Sencha seems to have all 3. That, and again their components are pretty cool.
As a consultant, their components, charts, Ext Designer, and website all demo nice as well making it easier to sell as an alternative to Flex.
I won’t get into much here, but suffice it to say I’ve yet to see the mobile revolution impact our clients as much as it has impacted the Design Agency sphere. While both focused on consumers, for a lot of brands, smart phones and tablets are seen as a growth market, or the ONLY market, to reach certain demographics. All the statistics point to both the behavioral change of society using their devices to interact with the digital world vs. computers, yet those same statistics also who the desktop still being the leader in PRODUCING that content that the world consumes. Yet given that, the money doesn’t seem to be flowing in lock step.
As such, most initiatives have been “it’d be cool to blow some money on”, “we have to provide something for iOS, even if it’s crap”, and the most common “wait… this won’t make any money”. While I know there are a lot of device work going on out there, it’s just not in my consulting sphere, or if it is, it’s at a extremely low profitability area and thus not worth investing in.
For now, the same large interfaces that we make on desktops do not transfer at all to smart phones nor tablets. Just like how people started to taking their iPhone’s to work, and companies stopped installing company phones, and later with Macs so companies started offering Mac’s as well as PC’s… so too will this have to happen with tablets before large companies even have it on their radar as a focused set of initiatives.
Obviously this is dependent on industry type, but we’re just not seeing it in the financial/insurance area, only slightly in the media company area (which I might add are the only ones who seem to care about Android).
…but let’s pretend it DOES matter. Let’s say a Director wants to know your mobile portability story? What do you tell them?
With Flex it was pretty straightforward: 60% to 80% of your Service and Application Layer code could be ported, with no change, to have the same Flex desktop application work on iPhone, iPad, Playbook, and Android devices. The missing piece here, is the device’s web browser.
While I’m a huge/firm believe in a long term native future for devices, there are still many use cases when a consumer is in a hurry and hits a company’s website expecting it to work. Considering some Operators only allow some applications to be downloaded over Wifi vs. 3G, this makes the website more important since even 3G can act as Edge. If you’re a business traveller, regardless if you’re on AT&T or Verizon, you know exactly what I’m talking about.
2 key examples include Marriott.com and PapaJohns.com. I encourage you to play with both on your iPhone/Android’s web browser. You’ll notice they try to duplicate the native look & feel paradigm. “It works like an app!”. Sometimes it works, sometimes it doesn’t. The responsiveness is the first thing you’ll notice that falls on it’s face. Apps just perform better, and consumers can tell. At least for now.
That’s not the point, though; notice how the functionality they need is forced to be simple because of the screen real estate being so small. There are a lot of use cases where even just a company mobile app is needed for its Desktop equivalent. Other times, you really do want to get as much information as possible from the user (a la Papa Johns). To me, Papa Johns is the perfect example of an application that an Enterprise would want on a phone, then they realize at the design/analyze phase/outset that most funtionality couldn’t be done, but shove in as much as they could anyway.
If you’re forced to comply, what do you do?
You use Sencha Touch.
Now the same story applies like it did in Flex with 1 key differnence: Using PhoneGap, you can now target everything. All devices including their web browser, all while sharing 60% to 80% of your Service and Application Layer code. In theory… I’ve heard a lot of negativity towards Sencha Touch v1, but apparently v2 is a lot better, haven’t investigated the code yet, just testing the components on devices.
Pretty cool, huh?
If you haven’t read João Saleiro’s article, and you’re a Flex Developer, I encourage you to do so. I’ve reached many of the same conclusions as he did. The comments also have a lot of good info as well. The most important being team velocity. Time is money. This isn’t important to just large companies, either.
There are a lot of things we can do better and faster in Flex for large scale applications. It doesn’t matter, however, for 2 reasons. First, while from a technical perspective Flex’ future is bright, from a marketing and business one it’s over. The next 5 years are the sunset. Like FORTRAN and Cobol, companies invested billions, and those applications that run parts of their business don’t magically disappear overnight. Second, even if we know it may be a better solution for some use cases (many objects like Visio, highly dynamic interactions w/many redraws, compositing images & video, etc), we’re ultimately beholden to what our clients want, even if we know what they need is different. Thus we have to do both: Flex and Ext JS.
Furthermore, unlike other server-side solutions, Ext JS lends itself quite well to hybrid solutions with Flex being used for certain use cases and the HTML stack for others, all on the same project. You and/or your firm having the capability to provide both is immensely valuable. Utilizing Sencha Touch and PhoneGap, you now have multiple mobile options in your tool belt as well.
For the record, I still believe using Ext JS will take longer and have a harder to track velocity compared to using Flex. That said, I’m still diving into Ext JS with a positive attitude.