Archive for January, 2008

Grey Line

I ran into an interesting blog written by a Flash programmer who feels that Adobe’s promotion of Flex puts him and other Flash programmers at a disadvantage.

He writes, “The times have changed and we all face the challenge to evolve. The fact that all these soon to be popular tools are build leveraging the Flash API is a tribute to the communities commitment and dedication to relentlessly extend the boundaries of the .swf format. Now we find ourselves competing with Java dudes…smart people, but no one knows the API better than us. We have worked with it from its infancy (/ syntax, tellTarget) to its current form.

It’s clear that the author of this blog fell in love with Flash many years ago. But unfortunately software development is business, and big guys (Adobe in this case) do what they have to do to deliver competitive software. I happened to be one of the “Java dudes” who is using Flex now. First, the good news, Java dudes are not smarter than Flash dudes. Each programming environment has its own tricks of the trade, and based on my experience, GUI programming is often more challenging that writing efficient code for the back end. It requires a programmer to be a little bit of an artist, which is not an easily acquirable skill.

But professional programmers should not take any programming language too personal. You can’t love something that can’t love you back! Programming languages are tools and we learn them as needed. Can you fall in love with a Phillips screwdriver? While our blogger uses a professional language, another one has written a love letter to Flash. This anomaly is also known as fetishism.

DVD melodies Era free Enigma album free music Nine Inch Nails download Rodney Atkins track buy mp3 Jennifer Lopez get Sorry music buy mp3 Era CD track Marcus Johnston CD song Enigma CD album Nine Inch Nails DVD track Era get album MOBY get melodies John Mayer DVD song Enigma buy melodies Nine Inch Nails cheap melodies MOBY free Nine Inch Nails track download mp3 Sting cheap The Cranberries song buy Jennifer Lopez music free song MOBY cheap song MOBY CD song Era get Contemplacion music download Jennifer Lopez mp3 download album MOBY free music MOBY download Marcus Johnston album DVD melodies Rodney Atkins DVD album John Mayer get Contemplacion melodies buy The Cranberries mp3 free John Mayer mp3 download mp3 Madonna buy Era track free Era song free Rodney Atkins mp3 get song Rodney Atkins free music John Mayer CD song Sting cheap album John Mayer get mp3 John Mayer cheap track Jennifer Lopez cheap melodies Nine Inch Nails free Rodney Atkins album free music Madonna buy John Mayer album free mp3 Rodney Atkins free melodies Enigma cheap Sorry song download melodies Era cheap Contemplacion album DVD song Sting download mp3 John Mayer get mp3 Marcus Johnston get music Duran Duran get Sorry melodies buy mp3 Sorry buy John Mayer track cheap music Duran Duran

Then, this blogger calls for the holly war, “My shout to the community is not to let the newcomers step on our turf. We hold the secrets of the flash API and are the rare ones familiar with its complexities, faults and vulnerabilities. Don’t give up, transition to AS3, learn MXML and help the community find ways to efficiently bridge the gap between Flex and Flash through your new IDE which should be Flex (SDK)”It seems that the author would like to create a community that knows and passes from generation to generation undocumented secrets of Flash. This reminds me of a movie Rush Hour 3, where a secret list of thirteen Triad leaders was tattooed on the back of the head of a beautiful woman. Anyone is willing to shave his/her head and right there a couple of little known Flash APIs?

Unfortunately some Java, PowerBuilder, and Coldfusion developers are in the same state of mind. They want to protect their skills no matter what by creating all kinds of lobbies and publishing posts that would despise anyone who “betrayed” their clan in favor of another language.

Several years ago I ran into an ad in a Man Seeking Woman section. After listing the race and body parameters he requested that she should know Visual Basic. Apparently, otherwise they’d have nothing to talk about over the morning coffee.

Hey, let’s be friends. Program in Flex, Flash, or Java, or do not program at all. If you are good at one programming language it’s just a matter of time to be good at another one.
Remember, if the only tool you have is a hammer, everything looks like a nail.

Yakov

Comments (4)

 

Grey Line

This is the first of the series of articles that Flex architects from Farata Systems will be posting over the next several months. We’ll introduce you to our own class library that goes by a working name theriabook. Over the last couple of years we’ve been successfully using various coding techniques and custom components that turned the application development in Flex into a RAD project.

I’ll start with some history and definitions. While working on the book “RIA with Flex and Java”, we’ve been building a library of reusable components for the book samples. Since the book writing was our moonlight activity, we’ve had a chance to try all these components at the battlefield – during our consulting gigs with various clients. Unfortunately, last week we’ve had to politely reject the offer of our publisher, Sys-Con Media for writing the second edition of that book. We just do not have time. So if you are thinking of purchasing a copy, do it sooner than later – it’ll be gone soon.

There are three ways of writing software:

1. Just write the code from scratch
2. Pick a framework and write the code by the rules dictated by this framework
3. Use selected components from one or more class libraries

To see the difference between a framework and a class library, visualize a construction site of new housing development. In one home site, you see a frame of the future house, rooms are laid out, and electrical wire are hanging everywhere . The site next to it just has a pile of construction materials – Anderson windows, 2X4th, et al. Of course, the latter gives you a lot more freedom as to how your future house will look like…as long as you know how to construct it.
We like freedom, and will be presenting not only our “Anderson windows”, but also instructions for using them during construction of your application. Best practices, as we currently see them. Your input is greatly appreciated and if you have your own construction materials or tricks of the trade, please add them to our pile.

All objects from our theriabook library will be available for free as an open source software governed by the MIT license – the same as Flex framework.
Without further ado, let’s go to our first best-practice.

To read more follow this link

Yakov Fain

Comments

 

Grey Line

At the end of 2006 I wrote in a blog that Flex programmers should sit tight, improve their skills and wait till 2008 – the year of their fame. The year of 2008 is here, and Flex people are in big demand. Two years ago, Flex community was more of a ghetto where most of the Flex programmers knew each other, but situation is different now. The number of Flex programmers is increasing, and this population evolves similarly to what I’ve seen in the Java camp in the past.
The main concern of any project manager is if there are enough people in the pool of Flex developers to staff the project. Yes, there is a pool of Flex developers, but let’s look at the creature called “Flex Developer” under the microscope.

Presently, I work for two clients from different industries; both projects are redesigns of existing Java applications. One project has a small number of Flex screens but very serious requirements for the communication layer. The other project has lots and lots of screens with LCDS on the back. Both projects require three types of Flex personnel:

1. Flex GUI developers
2. Flex component developers
3. Flex architects

The first group is people who can create the view portion of the application. This is the easiest group to get into if you already have some programming language behind your belt. The rumors about high consulting rates plus work of educators and technical evangelists create an impression that working with Flex is easy – just drag and drop components on the screen, align them nicely and write the functions to process button clicks or row selections in the data grid. Sort of a Visual Basic of the Web. These skills are easy to obtain, and you can expect a crowd of people there, but do not expect high pay rates in this segment. If something is easy to learn many people can master it, and savvy project managers either outsource this job to a third-part vendors or send their own developers to a one-week Flex training class.

GUI developers interact with Web Designers that come up with the look and feel of the screens, which can be presented as a wireframes created in Photoshop, some third-party tool or even in Flex itself. But even in the latter case, GUI developers should not start implementing screens until approved by a Flex component developer or an architect.

While this is a right way to start Flex career, you definitely should consider moving to the second group and become a Flex component developer. This title is awarded to people who know everything that GUI developers know plus object-oriented and event-driven programming. Knowledge of design patterns helps, but be careful here. Especially it applies to people coming from the Java world. Do not abuse MVC. Think out of the box. A screen created by a Web designer has to be scrutinized and redesigned into a set of components that communicate with each other. Applying the Mediator pattern to the initial wireframe is a good start as I’ve described in this blog .

Also, keep in mind that even though the syntax of ActionScript 3 looks very similar to Java, it has provisions for dynamic programming and you might not need to create tons of well defined objects as in Java.

The third group of people knows everything the first two groups plus they can see a big picture. They know how to build the entire application, how to communicate with the mid tier, how to structure your project, and how to make communication between reusable components, views and the persistence layer the most efficient. Flex architect are people who’d never suggest using a framework for creation a simple Video player as done in this blog. You do not gain these skills after a week of training, but you build them on top of your prior experience in other programming environments and by constant studying.

Not every Flex developer can be profiled as a member of one of these three groups. In smaller teams, one person may wear two hats: a component developer and an architect. If your team has decided to use one of the frameworks on top of Flex framework, you may wind up with a new type of team members that can be called framework coders. In this case it is assumed that this XYZ framework provides a structure that will take care of inter-communication between components, and coders just need to put their model, view or controller objects into the right directories, buy popcorn, press the button “Play” and watch the movie. This may or may not work as expected, but you may find out about it later in the game. If you are not lucky and the film got stuck in the projector and caught fire well into the movie, get ready to ask for an extra budget for a new project called “Removal of the XYZ framework”, which reminds me of a good old joke.

A poor man comes to the rabbi complaining that his family has only one small room, many kids, and almost no money. The rabbi says, “Take all your money, buy a goat, and keep the goat in your room. Come back in a month.”

“But, rabbi, we don’t have enough space even for us,” the man said
“Just do what I say,” the rabbi replied.

A month later the man comes back complaining that the goat smells and breaks everything.

“Sell the goat and come back in a month,” the rabbi tells him.
A month later the man comes back to the rabbi with flowers.

“Thank you, rabbi! We’re so happy the goat is out, now we have more room and some money from selling the goat!”

If you are considering adding Flex to your set of skills, it’s still early in the game and you can join the fast growing Flex community. Decide which group of the Flex developers looks most appealing to you. Set a goal and go for it. Be what you can be.

Yakov Fain

Comments (11)

 

Grey Line

Redmond Developer News has published an interview with Dr. James Gosling, creator of the Java language where among other things, he talks about JavaFX and competing technologies. And he made a comment I can’t agree with. Here’s the quote from that interview:

“As organizations think about building rich Internet applications or rich client applications, when should developers look at JavaFX over competing technologies?
If you look at something like Flash, when you get to the much more advanced stuff — richer interfaces, more complex network protocols, more complex APIs — it really falls short. We’ve had a platform for years that can build rich Internet applications that are extremely sophisticated.”

Before even going to technical details explaining why this statement is wrong, let me tell you that if someone would ask me to name a dozen of the most respectful people in the industry, James Gosling would be one of them. Because of him, I live in a nice house and drive a nice car – I’ve been doing Java for the last ten years. If James would not invent Java, I’d be probably still working with PowerBuilder writing that it’s the best thing since sliced bread.

But let’s go to the essence of the accusations. Dr. Gosling does not attack the presentation and delivery abilities of Flash Player because Flash Player is today’s leading delivery mechanism for rich Internet applications. He addresses network protocols, something that may not be as easy to argue. So let’s talk protocols.

In 2007, my colleague and I were invited by a financial company (a Java shop) to assess if they could create an Internet version of their trading application using Flex. They did not have any doubts the GUI part should be done in Flex and delivered to their customers by Flash Player. Using AJAX for such an application would be crazy.
Sun’s long history of ignoring Java as platform for delivering Internet applications ruled Java applets out. A dancing Duke made his short appearance in 1995 and was forgotten by Sun for the next 10 years. Can you imagine Amazon or Google using Java as a front end for their applications? It’d be insane – they’d lose a half of their customers trying to persuade them to use Java applets – each of them had different version of JRE and installing the right one required a college degree in computers. I hope this situation will change with the introduction of Consumer JRE later this year, but we are not there yet.

Anyway, this financial company was not sure if the communication protocols offered by Flex were robust enough to provide reliable and guaranteed message delivery and could be extended to accommodate specific needs of this application, such as adding the application-specific quality of service (QoS) information right to the packages sent over the network from the Flash client to Java server-side application. They wanted some other things too, such as message throttling in case of network congestion and more.

Flex offers a server-side piece called LiveCycle Data Services ES, which comes with a couple of fast communication protocols: AMF – a binary protocol that makes calls over HTTP from client to server (polling) and RTMP – real time messaging protocol that supports real time push from the server to Flash client. By the way, AMF goes open source in a month or so (see BlazeDS). Java offers RMI protocol for RPC and JMS for messaging. RTMP is easy to integrate with other messaging systems via JMS.

Under the hood, AMF and RTMP protocols implement object serialization, so an instance of a Java object gets serialized on one end and is recreated as an instance of the ActionScript object on the client inside Flash Player, which is nothing else but a VM. On the way back, an ActionScript object is serialized on the client and gets recreated in the server’s JVM as a Java object. Security is similar to Java applets (sandbox) and you can use RTMPS instead of RTMP.
One of the most important features of the Flex framework is that it’s extendable. The server side of implementation of these protocols is written in Java, and the client side in ActionScript 3. To make the story short, we were able to extend the communication channels, end points, message consumers and producers to enrich RTMP protocols to the clients specification. Now the messages about trading orders and executions travel happily between the Flash client and Java server. We’ve also added a two-way RPC-over-messaging in a symmetrical way.

This project was an example of a nice marriage between Flex and Java in a Wall Street application. If Flex has weak spots, it’s slow compiler and a mediocre (by Java standards) Eclipse-based IDE . Since Flex is open sourced now, I hope that some third-party company will create a better IDE and improve the compiler.

But as of now, I’m pretty happy with using both Java and Flex technologies, and the good part is that it’s not an either-or situation – just use the right tools for the job. There is no need to lobby for any particular language. As to JavaFX, I wish it to start competing with Flex and Silverlight as soon as possible. The more the merrier.

Some time ago I said to my kids, “Even if, God forbid, you’ll commit a crime, Mom and I will still love you and will try to protect you to the very end. You are our kids and we love you regardless of your achievements and personal qualities”. It seems that James Gosling has the same principles and protects his baby no matter what. I respect this but have my reservations.

James Gosling’s fan,
Yakov Fain

Comments (2)

 

Grey Line

Time magazine has published their version of 50 best Web sites of 2007 . Check it out. You may or may not agree with their ranking, but I’m sure you’ll find some interesting sites there that you did not know about. All these sites are Web2.0-ish, which by my definition are not the sites that were built using any particular technology, but rather the sites that give more control to the end user. So while some people say that Web 3.0 is about semantic Web, I believe that Web 3.0 sites will just give the end user more control than Web 2.0 ones.

But since developing rich Internet applications is my main professional activity, I could not stop myself from looking what’s under the hood at the Time’s Web site.

It’s good to see that they are gradually introducing Adobe Flex to their Web site. While most of the Web site is done using DHTML, the widget that shows “Top 5 Best Web Sites” is done in Adobe Flex. Just right-click on that area and you’ll see that it was delivered by Flash Player. To be more specific, most likely it’s a custom component that consists from a VBox container (a box with vertical layout) that in turn has an HBox and a DataGrid. The HBox holds the Label that reads Top 5 Best Web Sites” and two buttons – one is a button with an image Refresh Data and the other one is a button with a custom skin that looks like a circle(?). As you move your mouse over that button, you’ll see a tooltip that shows you a hint that the DataGrid below is sortable – just click on the column’s header. If Time developers read this blog, I’d appreciate if someone would confirm that I’ve guessed your Flex components selection correctly.

I applaud Time for using Flex. Just think about it, this little widget that displays the rating can be coded in no time – one hour for coding and testing and one hour for the skin creation, which can be done in parallel by a Web designer in Photoshop. The speed of development is crucial for any multimedia mega site such as Time magazine.

Of course, since they are just starting, there are some usability issues, for example if you sort the ratings table by any other than Rate column, the text of the Label above should change from “Top 5 Best Web Sites” to something else based on your sort criteria.

Another usability issue – there is a column Total Votes, but it’s not clear how the user can vote. I’d use a custom item renderer in the Total Votes column to turn the number of votes into a clickable link that would bring the user to the voting page. In Flex, this would take another 5 lines of code.

But these are the little things that will be ironed out in the future. Good job, Time Magazine! Go Flex!

Yakov Fain

Comments (2)