IDE Choices
The only professional quality Flex IDE currently available is Flex Builder from Adobe. Flex Builder is an eclipse plugin that has a short learning curve and a very nice GUI editor. If you plan to do any serious development you will need to get out your wallet and purchase a copy. Overall its a very sufficient tool to develop Flex applications but it's still a way behind Eclipse JDT and IntelliJ IDEA in terms of refactoring, code analysis and code generation.
No generics
I think generics were a great addition to Java 1.5, they made working with collections a whole lot easier and safer. I started to use them in my everyday coding and then after a while I started creating my own generic classes. It wasn't long before I couldn't imagine why any modern language wouldn't have them.
interface EditModel<E> {
public E getEditedObject();
}
EditModel<Customer> customerEditModel = ...
With generics I can create a nicely defined interface for editing any object, yet be sure that my customer edit model is editing customers and not 'Objects'.
Unfortunately Flex does not have generics. R.I.P.
No concurrency
Flex has no language support for concurrency so background processing is basically out of the equation. There are asynchronous events being used in some of the data access libraries I have used but seems like a bit of black magic to me.
No dependency injection
There are no commercial ready dependency injection frameworks available for Flex that I am aware of. If you have spent any time developing Java applications using a framework such as Spring or Google Guice, its going to be something you will sorely miss.
This means people out there are using a lot more singletons and testing a lot less than they should.
Minor things
- No abstract classes
- No method overloading
- No constants in interfaces
Im summary I would like to say that in my opinion Flex is a great language for developing UIs and related logic. If you are developing a rich client application (desktop or web) then Flex may be right up your alley. If not then you may well be better of using another language, or at least writing non UI code in another language.
15 comments:
Hi!
IDE: yes, that completely sncks, Adobe opensourced the 50% of the tool to make good money out of the other 50%. Fortunately you can use an XML editor to edit mxml files, I run the compiler through maven from a command line and use eclipse resource links to link it into a web application. Not very handy, but will do until I finish my flex incremental builder plugin... (this shouldn't take more than a few hours work for a real eclipse hacker, which I am not :))
Generics: There is no generics and I do not really see how they would simplify things.
Concurrency: There are threads, but your code should not create threads Imho.
Dependency injection: I think this is something you do not really need on the client side. There is data binding instead :)
I agree with the things you point out. The main downside of Flex is that it uses ActionScript, it are all problems in the language not in the programming model / framework.
It would be nice if they would have built top of Groovy for example :-)
However I still really like Flex, ActionScript is sufficient for client side stuff. AIR rocks too, but I do start to wonder if ActionScript is not too limited at the point that you write complete applications in it.
Hi kocka,
I'd appreciate any information on how to create threads, I did a search on this the other day and couldn't find anything that suggested it was possible.
Generics make it easy to create type safe collections. In java writing 'List<String>' is _almost_ the same as creating your own StringList class that only accepts strings.
I agree that data binding makes wiring together a flex app very easy. I'm not convinced it's the best approach though. For example, how do you effectively unit test code that is wired together using databinding?
Hi paul,
I haven't used AIR yet but I plan to in the near future, definately looking forward to it :)
My main issues with flex have arisen when trying to move UI logic out of mxml and into actionscript. For example I want to declare validation logic outside of my UI so I can reuse it across forms. On the whole it's actually not too bad, I think that as I gain more experience with it I'll like it more.
Nice post...
You have really pointed out some important items. Just out of curiosity, have you looked at Silverlight? This is an awesome development platform for developers who want to create RIAs
Well, you can make collections that have a rudimentary level of type-checking. You can create an ArrayCollection out of an Array that has compiler-level type-checking such as:
[ArrayElementType("_datatype_")]
public var customDataList:Array;
@Shanon - As far as moving UI logic out of MXML, Flex supports their own version of code behind or you can just use the good old mx:Script tag:
< mx:Script source="file_name.as" />
I agree that FlexBuilder still needs a lot of work to catch up to Java IDEs.
@ chad
I haven't looked at silverlight but I am aware that it is out there lurking in the shadows ready to steal some limelight from Flex :)
@darren
Thanks for your correction about type safe collections. I never knew that it was possible in Flex but know that I do, it's made my day!
Thanks!
Curl is another alternative language for RIAs that is designed with modern language features to support large scale development. It was originally designed and developed at MIT but has been commercially developed for the last 9 years, and first became popular in Asia. A clean and flexible design from a language standpoint.
I love you open source guys such as Kocka. You must bill at $10 per hour. Let me see, I can write own incremental build plugin, have no debugging, no design view, spend of bunch of time programming something that has already been invented. Buy the Flex Builder! If you make $100 to 150 per hour consulting, the IDE pays for itself a few hours and you have everything at your disposal for future projects. How dare Adobe make me productive and charge me for it. I am flying from LA to New York, walking is FREE. I apologize if this seems harsh, but there are times to spend money to make money.
"Im summary I would like to say that in my opinion Flex is a great language for developing UIs and related logic. If you are developing a rich client application (desktop or web) then Flex may be right up your alley. If not then you may well be better of using another language, or at least writing non UI code in another language."
I love this! Yes, you've unsuccessfully compared apples to oranges. Flex is for front end development and doesn't pretend to be anything else. You should be comparing flex to html, css, and javascript (or maybe silverlight when it grows up). You would be using java or .Net or something similar for all the backend heavy lifting anyway.
@bobrot
"You should be comparing flex to html, css, and javascript (or maybe silverlight when it grows up)."
This article is not a comparison of and Flex with other technologies.
"Flex is for front end development and doesn't pretend to be anything else."
A lot of people have never even heard of Flex. You assume too much.
After working for 7 years in Java(4+ years in Swing), I believe developing GUI applications in Flex is lot easier than doing in Swing.
Flex (ActionScript) may not be suitable for core business applications, but its lot easier to develop frontend GUI apps. ActionScript may not have Generics, OverLoading, etc, it have "Bindable", Java(Swing) dont have one supported in language(forget that mess of writing listenrs, properties..) For GUI development 'Bindable' alone makes my program much readable and under control.
.And that is what for Flex is made for GUI Development, (I dont think we can compare Flex(ActionScript) with Java).
@Shanon
It's most certainly an article comparing Flex with Java. The author clearly states that he's been a java developer and here's the things that java has that flex does not.
To your second point, if you're going to write an article based upon the shortcomings of a certain product, then you should most certainly have researched it and know about it. Though I may take your suggestion and begin writing articles about products I know nothing about :)
Dearest Bobrot,
Your right, I will concede that the article does in fact compare Flex to Java. I know you want me to compare one RIA language to another but that was not the goal of this article. I understand that comparing Flex to Java is not the purest form of comparison but it is a valid one. A java developer might be deciding whether to use Flex or just write a webstart application for example.
In any case I will take your feedback on board. I think that perhaps your problem stems from the fact that the introduction did not accurately reflect the purpose and content of the article. I am an inexperienced writer, so don't roast me too much for that.
As to your second point, you seem very confident in your superior knowledge of Flex. I look forward to reading your next blog entry, I'm sure it will be very informative!
@bobrot et al
If you don't believe an RIA might have to do some "heavy lifting" then I trust you are staunchly in that HTML/CSS/AJAX world yourself and have never had to create a responsive n-tier application in your tech space or one that might even need to be close to real-time/streaming, etc... The response times with Flex/AJAX are obscene compared to a good Java UI(owing in part to the black box threading model) and the whole VM is much slower. Is Adobe even up to JIT compilation, a 7 year old Java technology?
As others have pointed out, it's a very fair comparison as CTOs will be making RIA decisions between Flex and Java Swing. There's a lot you can't simply flip over to the backend depending on your app.
The reality of the market is such that many of us desktop/Webstart Java programmers will soon be migrating to this technology, as Java dies out on the client(sad to say) and looking at the shortcomings of this new technology is a very useful exercise.
What's driving the migration? Flash's adoption on the client vs Java's. There's not comparison. Sun can't get browser integration right. Period. Even the much heralded "advance" plugin, jdk6_10, is still a POS and crashes.
Reading about people getting all moist because they can run Flex on the desktop via AIR even though they need to download a 15 MB!!! runtime(read VM) tells you everything you need to know. For years, we've been hearing people bitch about downloading the JRE and now they can't wait to download AIR runtime. But that's proof enough of where the market's heading so we have to go with it.
Adobe has been very responsive though, much more so than Sun, so the more developers speak out, the more things will change. And yes, those of us coming from non Web app backgrounds will probably be making a lot of demands and hopefully driving a lot of change.
Post a Comment