What an iPhone and a pretty girl have in common

I ‘ve heard about iPhone from my twelve year old son shortly after Steve Jobs had announced it. My son already wants it badly for his next birthday. He ‘s planning to save money…

The iPhone is probably the topic of the week in the blogosphere, and every blog has the same title, “O man, it ‘s so cool, I want it now “. I am a blogger too, and will join the crowd, but the title of my blog is a bit different. If you spent this week in the rain forest, deep in the coal mine, or in Turkmenistan, where only about 300 people have access to the Internet , you may not know that iPhone is a little thingy of the size of iPod that combines the iPod, cell phone with no keys, and an Internet browser. The software runs under the OS X system.

Steve Jobs did an amazing job with iPod and wants to pull it off again. Those people who had a chance to play with it often say “It feels amazing in your hand “. From a practical point of view, it may not make much sense to pay $600 for an advanced iPod with only 8Gb of space, and a phone services by Cingular, but I ‘m sure people will be camping out for several days by the stores when THE DATE will be announced. These annoying guys from Cisco sue Apple over the iPhone name , but Steve will give them some cash to make them happy.

And the reason is simple. People like nice looking and fashionable things, regardless of if it makes practical sense or not.

I see a clear analogy between why people will buy iPhone and why men like to date and marry pretty women. She looks so beautiful, everyone turn their heads when they see us, she ‘s blond, long legs, and she feels amazing in your hands…From the functional perspective she ‘s not the best choice – I ‘ve already hired a housekeeper and we are ordering Chinese or pizza every other day, but who cares – when I come home from work I ‘ll see her sitting on the couch in front of the TV in this mini skirt after visiting a beauty salon… She ‘s smiling at me….She ‘s ready whenever I am…And she ‘s mine…I ‘m in control…I ‘m the man!

That ‘s why people will go and purchase this pretty thing called iPhone. It does not matter that you ‘ll need to take a second mortgage on the house to get it – your bank offers installments… You want it, and you want it now. Consume!

A bunch of Flex Builder plugins is almost ready

I wanted to take a moment and share with you what ‘s cooking in the secret underground labs of Farata Systems. We are about to release Beta versions of several commercial plugins for Flex Builder, namely: Flex2Ant, Logger, DaoFlex, Flex2Doc and FlexBI. In this blog I ‘ll show you some screenshots from the first three.

1. Flex2Ant

This plugin will automatically create an Ant build file from your Flex Builder project. Just right-click on your project ‘s name and select the option Generate Ant build file:

In a couple of seconds you ‘ll find two new files in your project – flex2ant-build.xml and flex2ant-config.xml:

Now, either right-click on the build file and perform the Ant build as shown below, or do it from a command line. Easy.

2. The Logger

Not only you do not need to depend on using trace() or running the debug version of Flash Player, production support of your enterprise Flex applications becomes a lot easier and a lot less expensive. I ‘m not even sure if Java developers accustomed to log4j have such a plugin yet? Check it out. The logger has a pluggable view panel. You don ‘t like this one, no biggie – create your own.

Our Logger plugin automatically inserts the mxml tags or ActionScript code required for logging by using hot keys shown at the right bottom corner of the screen below:

And this is my favorite part. Visualize myself sitting with my laptop by the beach somewhere in Florida – I ‘m a proud member of the production support team for a Flex application deployed by my global client across the world. Jennifer, the user from Alaska calls me saying that there is a problem with her application in production. I ask her to press Ctrl-Shift-Backspace, which pops up the Logger panel screen shown below.

Now I ask Jennifer (the end user) to change the default level to Debug and check off a couple of check boxes by the suspicious class names. At the bottom of the screen select Remote Logging option, enter the name of the destination (in this case RemoteLoggingPrivate) and the password and to start working with her application again. The next step for me is to put my glass with Margarita aside and watch Jennifer ‘s log messages directed at the specified destination (that ‘s right, RemoteLoggingPrivate).

Oops…What ‘s this? Dear corporate production managers, please stop throwing money at us. The logger is about to enter Beta. I know, it ‘ll save you tons of money…Just give us another month or so.

3. The DaoFlex plugin

After seeing a huge success of our command line code generator utility DaoFlex for Flex and Java, we ‘ve decided to productionize it and create a Flex Builder plugin. Take a look:

Configure your database connection in the screen above in your Java project in Eclipse. This project has a pretty simple Java class, say Employee.java that includes an SQL Select statement to be used in your CRUD Flex/Java application and a couple of more tags. The server deployment parameters are configured pretty easy (it ‘s Tomcat in our sample):

DaoFlex is a part of Java compilation/code generation process like Flex that spawns “generated ” helper classes upon build to do mandane work, and this plugin will not only generate all required artifacts (Java classes, xml configuration files ActionScript and MXML), but will deploy the Java Web application under the specified server. We ran the Flex client of our CRUD Employee application right in Eclipse.

By default, DAOFlex plugin generates two sets of MXML (and configured destinations) – one if you want to use RemoteObject, and the other if you prefer to use the DataService tag. It took me longer to write this short description of DaoFlex plugin then generate the entire application.

That ‘s all for today. How much? We ‘ll announce the prices of the above components next month, but I can just say that they ‘ll be very inexpensive for individual Flex developers, more expensive for Enterprise customers, but still cheaper than purchasing a Flex Builder license.

A blog on Flex2Doc – plugin and community site for documentation generator/context search on Flex projects from IDE/Eclipse help generator is coming tomorrow. And I can ‘t wait till February, when we ‘ll start showing off our most advanced reporting designer/databound control editor FlexBI.

This is a Conference 2.0. Really

Even though I write for Sys-Con, I ‘ve never publicly complimented them. But this time they really deserve a credit. Sys-Con will run an AJAXWorld 2007 conference in March. Usually, attendees have very limited access to speakers during conferences, and Sys-Con came out with a simple but smart idea – yesterday they have created a forum , where anyone can post questions to the conference speakers. And you do not even have to attend the conference to participate in this forum. It ‘s a very nice idea, or rather Idea 2.0.

Speakers should visit the forum and answer the questions to promote their sessions, and software developers will have a chance to correspond with well known people in the industry.

Yours truly will run Adobe Flex hands-on workshop during this event, so feel free to post relevant questions – it does not matter if you are planning to be there or not.

I ‘m sure, other event organizers will start copycatting Sys-Con, which is a win-win situation for everyone.

75% of employees are looking for new jobs

As per today ‘s eWeek magazine, CareerJournal.com claims that 75% of employees are currently looking for new jobs. But it seems that eWeek does not know why. Let me give them a hand here…

This is a time of the year when experienced recruiters start their calls with a question, “Did you get your bonus yet? “. They correctly assume that the bonus will be smaller than expected/promised, and people will start looking for new jobs. Most of the C-level IT managers have kept their employees on a leash last year with the help of some mysterious bonus. You better behave, or else. But a miracle did not hapen this year either, and given a healthy situation on IT market, it ‘s time to move. It ‘s elementary, Watson!

So, did you get your bonus yet?

Forrester: Ajax Or Flex?: How To Select RIA Technologies

If you have extra $379, read the 7-page Forrester report on the subject. If you don ‘t, read my blogs for free – I came to the same conclusion – go with Flex. Or, you can read this blog of Ryan Stewart who read this report.

We ‘ve been writing about this before, and you should not miss an important statement highlighted in this report – if you use AJAX most likely you ‘ll go either with a commercial or a home-grown AJAX framework. In either case you should compare not AJAX vs. Flex, but a particular AJAX framework backed by a small group of developers of the company XYZ vs. Flex backed by Adobe. This makes a difference, doesn ‘t it?

One more reminder – regardless of what AJAX framework you use, you are going to deploy JavaScript. I have a question to those who argue that today ‘s JavaScript is a good language for development of enterprise applications, “Why every vendor of AJAX framework starts their infomercials with a statement ‘With our framework you will not need to write even a line of JavaScript? ‘ ”

But AJAX deserves a credit for turning people towards RIA development. Eventually, developers will realize that it ‘s not as rosy as promised and will look for a different RIA solution. But if you are already in a RIA state of mind, you ‘ll never go back to plain HTML Web pages. Remember Hotel California? You can checkout any time you like, But you can never leave!

Now, real quick $379/7=$54.14. Both Forrester and I write the same thing, but they charge $54 per page, while I write all my blogs and articles for free. Life is not fair. Should I just change my last name to Forrester?

What questions to ask during the job interview

Typically, at the end of job interview the interviewer asks you, “Do you have any questions for me? “. This is a very tricky situation – you may kill the deal by asking the wrong questions. I prefer asking something very neutral, like “How many people work on the project “, or “What would be my role if you ‘d hire me “. The job interview is not the right place for showing your attitude.

Bruce Eckel has published a blog where he lists a number of questions you may ask your perspective employer during a job interview. Even though Bruce tries to be careful in asking questions, you can still feel that he ‘s a senior guy who will eventually ask for some special arrangements like working from home or having flexible hours. My only advice to you is this – be careful during the interview. Get the offer first, and only after that ask your questions – you can always reject the offer if you don ‘t like the answers. Also, Bruce is a very respected person in the Java community, and his impeccable reputation allows him to ask more questions than a regular Java-Joe can.

I also enjoyed reading comments to Bruce ‘s blog. IMHO, most of these questions would kill the deal, and most likely none of these responders would actually ask these questions during the interview.

Some time ago I wrote an article on the interviewing process , which might be useful for people who are just starting dealing with job market.

Should Java developers learn Flex – mixed feelings

While majority of Java programmers are still in denial, once in a while I “m getting emails or comments on my blog like this one from yesterday: “Are there any deployments out there that use Flex for the RIA or this is still at the infancy level? rdquo;

Basically, this question could be re-phrased like this rdquo;Should I invest my time in learning this technology, are there any real (billable) projects going on in Flex? rdquo;, or like this: “I am a Java developer, and do not have too much time in my hands – do you recommend me learning Flex rdquo; hellip;

It “s not an easy question to answer ndash; I have mixed feelings. But first, let me define the term (I “m planning to submit this entry to Wikipedia): “Mixed feelings is when your mother-in-law gets into a car accident while driving your new Mercedes rdquo;.

I have mixed feelings because if you become a Flex programmer, you ‘ll start competing with me, and my rates will go down. On the other hand, if more people know Flex, more new projects will open up, and I ‘ll get more gigs. Last year I was working on two billable projects developing enterprise Flex applications, and on three Java projects.

If you look at Dice.com, there is not too many real jobs with Flex yet, but guess what, there is fewer people than jobs. Consulting rates for people with Flex/Java skills are about 20% higher than for people with just-Java skills. We at Farata Systems are constantly looking (do not confuse with hiring) for good Flex/Java developers. BTW, your Java skills remain valuable and relevant, and Java still remains the #1 language for developing enterprise applications. But knowing something else in addition to Java can ‘t hurt.

Actually, you know what, just keep sitting on the fence for another year or two, while I ‘ll take care of my retirement using Flex.

Memorable Posts

Memorable Posts

PowerBuilder

Fifteen years in America

Visiting an Offshore camp

Freedom?

Why Americans smile

What’s your salary?

Agile Development

Program in Style

Protected Variables

Your mother is ugly

Dead souls

WTFM

Interviewing techniques

Eclipse to Borland

Programming dies in US

Russian Programmers

Sending data from Flex to a JavaServer Page

This is a part two of the prior blog where I described how to get data from JSP to Flex. This time we ‘ll send data from a Flex application played by Flash Player to a Java Server Page. In the next version of our Flex-JSP application I “ll show you how to post data from a Flex form to JSP. We “ll place a simple form under the data grid above to enter the data about the new employee as in Figure below. Pressing the button Add Employee will submit the entered data to the JSP, which will attach them to existing employees and return back so the data grid will be repopulated to include the newly inserted employee.

To design the form, we “ll be using Flex objects lt;mx:Form gt; container, which differs from the HTML tag lt;form gt;. The latter is an invisible container that holds some data, while lt;mx:Form gt; is used to arrange on the screen input controls with their labels. We “ll also use lt;mx:Model gt; to store the data bound to our lt;mx:Form gt;. Let “s also make the employee name a required field and add so called validator to prevent the user from submitting the form without entering the name. It will look as follows:

lt;mx:StringValidator id= “empNameVld ” source= “{empName} ” property= “text ” / gt;

lt;mx:Model id= “employeeModel ” gt;

lt;root gt;

lt;empName gt;{empName.text} lt;/empName gt;

lt;age gt;{age.text} lt;/age gt;

lt;skills gt;{skills.text} lt;/skills gt;

lt;/root gt;

lt;/mx:Model gt;

lt;mx:Form width= “100% ” height= “100% ” gt;

lt;mx:FormItem label= “Enter name: ” required= “true ” gt;

lt;mx:TextInput id= “empName ” / gt;

lt;/mx:FormItem gt;

lt;mx:FormItem label= “Enter age: ” gt;

lt;mx:TextInput id= “age ” / gt;

lt;/mx:FormItem gt;

lt;mx:FormItem label= “Enter skills ” gt;

lt;mx:TextInput id= “skills ” / gt;

lt;/mx:FormItem gt;

lt;mx:Button label= “Add Employee ” click= “submitForm() “/ gt;

lt;/mx:Form gt;

The attribute required=true displays a red asterisk by the required field but does not do any validation. The lt;mx:StringValidator gt; displays the prompt “This field is required rdquo; and makes the border of the required field red if you move the cursor out of the name field while it “s empty, and shows a prompt when you return to this field again as in Figure below. But we “d like to turn off this default validation by adding the property triggerEvent with a blank value:

lt;mx:StringValidator id= “empNameValidator ” source= “{empName} ”

property= “text ” triggerEvent= ” “/ gt;

We “ll also add our own AS3 function validateEmpName(). Now the click event of the Add Employee button will call validateName(), which in turn will either call the function submitForm() if the name was entered, or display a message box “Employee name can not be blank ” otherwise.

Validators are outside of the scope of this chapter, and we “ll just mention that Flex comes with a number of pre-defined classes that derived from the base class Validator. They ensure that the input data meet certain rules. The names of these classes are self explanatory: DateValidator, EmailValidator, PhoneNumberValidater, NumberValidator, RegExValidator, CreditCardValidator, ZipCodeValidator and StringValidator. These validators work on the client side, and round trips to the server are not required. A program initiates the validation process either as a response to an event or by direct call to the method validate() of the appropriate validator instance as shown below.

The final version of the Flex portion of our application is shown below.

lt;?xml version= “1.0 ” encoding= “utf-8 “? gt;

lt;mx:Application xmlns:mx= “http://www.adobe.com/2006/mxml

applicationComplete= “employees.send() ” gt;

lt;mx:HTTPService id= “employees ” useProxy= “false ” method= “POST ”

url= “http://localhost:8080/test/employees.jsp ” result= “onResult(event) ” / gt;

lt;mx:DataGrid dataProvider= “{employees.lastResult.people.person} ” width= “100% ” gt;

lt;mx:columns gt;

lt;mx:DataGridColumn dataField= “name ” headerText= “Name ” / gt;

lt;mx:DataGridColumn dataField= “age ” headerText= “Age “/ gt;

lt;mx:DataGridColumn dataField= “skills ” headerText= “Skills “/ gt;

lt;/mx:columns gt;

lt;/mx:DataGrid gt;

lt;mx:StringValidator id= “empNameValidator ” source= “{empName} ”

property= “text ” triggerEvent= ” “/ gt;

lt;mx:Model id= “employeeModel ” gt;

lt;root gt;

lt;empName gt;{empName.text} lt;/empName gt;

lt;age gt;{age.text} lt;/age gt;

lt;skills gt;{skills.text} lt;/skills gt;

lt;/root gt;

lt;/mx:Model gt;

lt;mx:Form width= “100% ” height= “100% ” gt;

lt;mx:FormItem label= “Enter name: ” required= “true ” gt;

lt;mx:TextInput id= “empName ” / gt;

lt;/mx:FormItem gt;

lt;mx:FormItem label= “Enter age: ” gt;

lt;mx:TextInput id= “age ” / gt;

lt;/mx:FormItem gt;

lt;mx:FormItem label= “Enter skills ” gt;

lt;mx:TextInput id= “skills ” / gt;

lt;/mx:FormItem gt;

lt;!–mx:Button label= “Add Employee ” click= “submitForm() “/– gt;

lt;mx:Button label= “Add Employee ” click= “validateEmpName() “/ gt;

lt;/mx:Form gt;

lt;mx:Script gt;

lt;![CDATA[

import mx.events.ValidationResultEvent;

import mx.controls.Alert;

private function validateEmpName():void{

if (empNameValidator.validate().type == ValidationResultEvent.VALID){

submitForm();

} else{

Alert.show( “Employee name can not be blank “);

}

}

private function submitForm():void {

employees.cancel();

employees.send(employeeModel);

}

private function onResult(event:Event):void{

trace( ‘Got the result ‘); // works only in the debug mode

return;

}

]] gt;

lt;/mx:Script gt;

lt;/mx:Application gt;

When the user hits the button Add Employee on the form, our HTTPService will submit the employeeModel to a modified employees.jsp, which now will get the parameters from the HTTPRequest object, prepare the new XML element newNode from the received data, concatenate it to the original three employees, and return it back to the client, which will display all employees in the datagrid. Here “s the new version of employee.jsp:

lt;%

String employees= ” lt;?xml version=\ “1.0\ ” encoding=\ “UTF-8\ “? gt; lt;people gt; lt;person gt; lt;name gt;Alex Olson lt;/name gt; lt;age gt;22 lt;/age gt; lt;skills gt;java, HTML, SQL lt;/skills gt; lt;/person gt; lt;person gt; lt;name gt;Brandon Smith lt;/name gt; lt;age gt;21 lt;/age gt; lt;skills gt;PowerScript, JavaScript, ActionScript lt;/skills gt; lt;/person gt; lt;person gt; lt;name gt;Jeremy Plant lt;/name gt; lt;age gt;20 lt;/age gt; lt;skills gt;SQL, C++, Java lt;/skills gt; lt;/person gt; “;

// Get the parameters entered in the GUI form

String name=request.getParameter( “empName “);

String age=request.getParameter( “age “);

String skills=request.getParameter( “skills “);

String newEmployee= ” lt;person gt; lt;name gt; ” + name+ ” lt;/name gt; lt;age gt; ” + age + ” lt;/age gt; lt;skills gt; ”

+ skills + ” lt;/skills gt; lt;/person gt; “;

if (name == null){

newEmployee= ” “;

}

// the xml goes back to the Web browser via HTTPResponse

out.println(employees + newEmployee + ” lt;/people gt; “);

% gt;

Figure. The employee form and default validator “s message

Note: There are other ways to pass the data from Flex to an existing Web application. For example, you can create an instance of the URLVariables object, create the data to be passed as its properties, attach URLVariables to URLRequest.data and call navigateToURL().