Weve taught Adobe Flex to talk to Microsoft Excel

We are finishing writing our book on RIA with Flex and Java , and the last chapter is called “Integration with External Applications “. It ‘s sixty five pages of some advanced read. After writing this chapter one of us suggested that it would be easier to re-write Excel from scratch. It ‘s not straightforward coding, but the results are good. After covering some basics about ExternalInterface and how it enables bi-directional communications between JavaScript inside HTML page and embedded Flex application, this chapter leads you through jungles of Flash technologies such as External API and LocalConnection as well as through maze of Microsoft old timers like ADODB and OWC. We have been coding in VBA, JavaScript, XSLT, not to mention the ActionScript, of course.

We ‘ve also provided the code for a more complex example of integration with external applications, namely Microsoft Excel. These days the data entry or analytical applications with no Excel integration are simply hard to find. Be that saving of data in native Excel format or CSV, accepting data entered in Excel or dynamically creating Excel Charts based on the database queries ndash; we see it everywhere. Microsoft Excel is one of the most popular business applications ever .

This solution involves two ActiveX objects embedded in an HTML page with instant as well as on demand data synchronization between the objects. One of these ActiveX objects is the Flash Player control, executing Flex application. The second ActiveX is a Spreadsheet from Microsoft Office Web Components (OWC). You may think about Spreadsheet as of miniature Microsoft Excel application running inside the HTML page.

Disclaimer: This particular sample works under IE in Windows XP, but has some issues on Windows 2000. I ‘m sure, if you are still running Window 98 you may face some issues as well, which we ‘ll be happy to fix for its customers. If you do not see the spreadsheet while running this example, most likely you do not have OWC installed – get it from this site .

Meanwhile try to make changes in the left (Flex) and right (Excel) spreadsheets and the data should be replicated back and forth. We ‘d appreciate any suggestions/critique of this application.

Application like this opens the doors to some interesting project ideas: we also know how to generate and execute formulas on the fly, provide proper reporting and printing, and more. But that ‘s later. Let ‘s finish the book first.

The best programming language

eWeek magazine published an article titled “10 Programming languages you should learn right now “. You may also find Tiobe statistics useful in making the what-to-learn-next decision (it ‘s sad to see that PowerBuilder is as popular as Algol and PL/1).

I believe that in era of outsourcing, when programmer are treated as a commodities that you can easily purchased by a dozen, learning the business you are in has a higher priority than any specific programming language.

The name of the programming language does not matter as long as you are in top 20% of developers in this language. I ‘m sure, best Cobol programmers never have problems finding jobs.

My logic is simple: most of the programming jobs will be outsourced and not because programmers in India charge less ( in most cases it ‘s not cheaper at all), but because the pool of programmers here in America is shrinking year after year. Enrollment in Computer Science in all US colleges goes down.

Not every programmer is or can become a superstar. Some people write computer programs because it pays better than delivering pizza, painting or acting in Broadway musicals. They come home after work and forget about programming while enjoying other activities (delivering pizzas, painting or acting in Broadway musicals). If you are looking for job security, and can ‘t get into these 20% of the best, learn business you ‘re currently in (finance, telecommunications, entertainment, pharmaceutical, et al). A mediocre programmer with business knowledge will always find a job. This rule does not apply to people that develop general software and work for companies like Yahoo, Google and the like. But usually, people in these companies technically are pretty good anyway. For the reference: main languages at Google are C++, Java and Python.

The other strategy to use is to become one of the best in on of the least popular programming languages. The job market will be very narrow, but there is literally no competition, cause everyone wants to program in cool languages. Back in 1992 I ‘ve been doing SQLWindows from Gupta a.k.a. Centura. Anyone remember this? Certainly not Tiobe. Guess what, I know a lady who works as a Centura contractor charging top dollars. My wife is still a PowerBuilder programmer and her check comes in the mail regularly regardless of what eWeeks or Tiobe writes. Wondering when Cobol will die? Not within the next thirty years: there is no money for the funeral as too many applications are deploed (and work!) in production. So if you are already a Cobol programmer, you might be better off just improving your Cobol and related skills than learning Java. But again, this ‘ll work only if you are capable of getting into these 20% of top Cobol ‘eros.

Recently, I was interviewing Bruce Tate , and he suggested that learning another programming language will help you to become a better programmer in your primary language. I agree, this is a good idea.

Set yourself a goal to learn one additional language each year, and you ‘ll definitely will become a better and more marketable software developer. Which one to learn? Follow me as I have a pretty good nose for what ‘s going to be hot next. Do not trust me? No problemo.

Bill Gates drives a 7 year old porsche

Ten years ago, driving a new and luxury car was one of my pleasures. It was important to me. I always tried to convince my wife that it ‘s time to change the car and get something newer and more expensive. This has changed. Now my wife is asking me when I ‘m planning to replace my 7 year old car. But I ‘m not planning to. The car is reliable and is in a decent shape. I was surprised to learn that people who can afford a bit more than myself also drive their old cars. At least we have something in common!

Forbes Autos published a list of vehicles owned by rich and famous. People from the Western countries (except Larry Ellison) drive modestly priced cars. See for yourself (net worth and vehicle owned):

Bill Gates: $50B/Porsche 911, 1999

Warren Buffet: $42B/Lincoln Town Car, 2001

Ingvar Kamprad: $28B/Volvo 240, 1993

Paul Allen: $22B/Porsche 959, 1988

Michael Dell: $17B/Porsche Boxter, 2004

Larry Ellison: $16B/ Bentley Continental, 2006

Yakov Fain: $0 debt/ Infiniti I30, 1999

See Forbes Auto for more details. If you think that having a zero debt is not an achievement, take a look at your last credit card statement. Having zero debt is a luxury that at least 90% of Americans can not afford .

Did you notice that lots of richest people in the world have something to do with computer business? Let ‘s make it clear: they are not programmers, they manage programmers. I guess, I should also stop writing code and do some software business. But still, I ‘m not replacing my car this year.

OReilly billing system sucks

This morning I tried to purchase a book from Oreilly Safari Web site. Twenty minutes later I still can ‘t paid for the book…

When I filled my credit card information online and pressed the button Submit, it gave me an error saying that they could not charge my credit card and should either contact the bank or use another one. I thought that there was a typo in the CC number, so I went to my account information page. Too late….The field with my correctly typed CC number was disabled and I could not do anything about it.

Then I called tech support and they politely explained me that the charge was denied by my bank (Amex) since it came from Netherlands. From where? I ‘m in New York. Let me pinch myself real quick…Yes, midtown Manhattan. No, I do not smoke weed, and never been to Amsterdam ‘s coffee shops.

Then I was told that O ‘Reilly keeps their billing servers in Netherlands, so the charges come to my bank from Europe. He said it ‘s not their fault that my bank set these restrictions and I should call my bank and authorize charges from Europe.

No guys, it ‘s not my banks problem. It ‘s your problem that you decided to outsource your billing to Netherlands (is it that cheap out there?). Outsourcing sucks. O ‘Reilly is the best publisher of technical books, but their billing system sucks. For now I just won ‘t buy this $30 book from Safari. I ‘m angry. Say No to drugs!

A couple of negative reviews of Ruby

The latest SDTimes magazine has published two editorials with negative reviews of the Ruby language

The first is negative, and the second one is not positive either..

Main complains are: long learning curve, slow execution and lack of tools.

I do not have experience with Ruby yet, but at least two out of these three cons would stop me from using any programming language. Long learning curve is no big deal. I can live with memorizing cryptic looking commands and operators: I still can not memorize all shortcut keys and commands of infamous vi editor, which does not stop me from using it – Google helps when needed.

But the other two are biggies: slowness and lack of tools. Programmers are spoiled these days by fast run-times, just-in-time compilers, and the like. Programmers are spoiled by excellent IDEs, debugger, progiles, test and reporting tools, etc. To put it simple… just give me a second to make the font larger

We need the full stack. That ‘s it. Period. Basta.

My primary language of choice is Java with abundance of everything. I need a really really good reason to switch. The fact that one language has an xyz element while another do not, is not a good reason to switch. We need a comfortable environments. Who can offer you this? Open source community? Yeah, right…see you in five years. It ‘s gotta be a commercial software company with a well oiled marketing machine. Otherwise expect the fate of Lisp or SmallTalk. Just having a group of loud enthusiasts does not cut it.

But Ruby has a chance, namely JRuby if Sun Microsystems will start pushing it. They ‘ve hired two lead JRuby developers , which may be a lot more important event for Ruby that existence of RoR and its followers. Let ‘s wait and see.

Thoughts after persenting Flex to Java developers in New York

Tonight my colleague Victor and I were presenting were presenting Adobe Flex to the one of the largest and most active Java Users Group in the world: New York ‘s Java SIG. This is one of the toughest audiences to talk to for a couple of reasons:

1. People are very technical : these are Java developers with many years of experience.

2. This is New York – they ‘ve seen it all. Frank Greco, the leader of this JUG usually invites well known speakers in the Java community – see for yourself. Tonight ‘s meeting was held at Google ‘s NYC site and more than 100 armed and dangerous Java developers came to listen to the next big thing.

First, I spent 50 minutes or so showing different live sample business applications that would retrieve data from various servers using POJOs, JSP, HTTPServices, displayed charts, etc. I was targeting mainly Wall Street crowd. Then, Victor spent another 30 minutes showing our components that automatically generate Flex and Java code for you and a really useful reporting component that we call FlexBI.

Our presentation was well received: no standing ovations just applauds, but now I know that I should have done it differently. My main message was that using Flex 2 is easier (read less expensive) than similar development in Swing. The rich Internet application that I demoed, would have taken three times longer to do in Swing. But after the presentation one developer stopped by saying, “I can do everything you did in Java Swing “. I repeated again that it ‘s cheaper with Flex, but he was not too convinced. Then I realized that he ‘s looking not so much for business applications, but for a cool stuff. So I ran an application that connected to Flickr downloaded photos with a fancy scroller and zooming, and he was immediately impressed.

The bottom line: people are looking for a cool looking things. Next time I ‘ll start with 15 min foreplay showing flashy multi-media applications. And when the audience will be impressed, I ‘ll go down to the dry details like data binding XML parsing and integration with Java.

The other person asked me if Flash is applicable for his heart research programs. I showed him a chart component that look similar to Google Finance, and he agreed that the same way he could display data points with some live data about the heart.

Here ‘s another typical question, “We are using a no-name framework and can produce similar screens “. This was an easy one: there are lots and lots of semi-professional tools or frameworks, but Adobe Flex 2 ia a well designed and well documented plaftorm that offers the entire stack of solutions required by modern RIA.

Another thing I ‘ve noticed is a silent resistence hanging in the air: “I can do everything in Java “. Adobe technical evangelists will need to work hard to melt this ice in the eyes of Java developers.

One more observation, Java developers are used to having of large amounts of the boilerplate code generated for them by IDEs and other build automation tools. It ‘s hard to impress them with compact and elegant Flex samples. And, to be honest, when it comes to real worl applicatoins, you still need to write code regardless of what programming language you are using. My message “size matters – the smaller the better ” was well recieved by other audiences, but this time it was like “So what? “.

In general, it was a well spent evening, and in three month I ‘ll repeat this presentation at Princeton JUG , but I ‘ll make it more Flashy as is required for all normal people such as Java developers.

More on Adobe Flex vs. Java Swing

JDJ reprinted my blog “Who is winning the desktop… “, and one of the readers left a comment there. Here ‘s the comment and my answer to it.

This is what the reader “m ” writes:

“I believe that Yakov ‘s credibility with me evaporated when he claimed just ‘5 seconds ‘ to be installed and running the demo. The installation requires a browser restart which can take longer than that in itself. Furthermore, Flash installations fail all the time. Several times in recent months I have had to completely uninstall and reinstall browsers in order to get the Flash install to actually work.

I ‘m getting pretty sick of the myth that Flash applications ‘just work ‘. They mysteriously hang and mis-display elements all the time. My kids play lots of on-line games and CD-deployed games that are written in Flash and we always seem to be hopping from browser to browser and even between operating systems trying to get a combination that works with some particular flash app. How is this better than Java?

Flash is pretty easy to create simple apps with, but anything sophisticated seems (imho) to get bogged down and kludgy. The code quickly becomes a mess to maintain and the UIs are so cartoonish so often. I realize that the latter are symptomatic of the skills of the developers, but hey – maybe that is the point – by the time a Flash developer has the skill to do a decent sophisticated app, doesn ‘t he charge just as much as the skilled Java developer?

And the size of flash apps does bloom with the sophistication of the app quite a bit, just like java. And finally, why is it okay to have to download and install the flash runtime before you are able to run a flash app but the need to download and install a java runtime is somehow held against Java?

The fact is, the percentage of systems that already have Java installed on them is growing and growing. All Macs have it. Nearly every new Linux system and lately the vast majority of new Windows machines already have it. And if you don ‘t it is a pretty painless download amp; install experience to get it.

Fain completely ignores the growing number of java desktop applications based on the Eclipse/OSGi platform. Convenient oversite.

The comment that Java developers and advocates are going to argue here because “Java Swing puts bread on their tables. They do not want changes. They do not want to learn another language or tool. ” is so weak. One can easily turn that around that numerous advocates of alternatives (Flash, etc) are casting FUD about Java because they want to get their fingers on the same economic pie. So back off on the holier-than-thou attitude.

This isn ‘t about fear of change (most developers have no fear about learning new technology, including languages) – this is about whether the change makes sense. Developers do have a fear of wasting time learning technologies that don ‘t add new value. For the vast majority of it solutions out there, Java does make sense. Not all. But advocating for change simply for change ‘s sake – especially when you are ignoring established solutions for the same problems – is wasteful and intellectually dishonest.

Change to solve new problems or old ones in a better way is good. Change just for change ‘s sake may or may not be good. ”

And this is my response:

Dear m,

I ‘m really sorry to hear that my credibility with you have evaporated because the ‘5 seconds ‘ install did not work for you, and because I decided to use anything in addition to Java. Usually Flash express install is pretty quick, but hey, it ‘s software.

Your other comments on Flash are applicable to previous version of Flex/ActionScript. But I ‘m talking here about Flex 2, ActionScript 3.0, Eclipse-based IDE, and Flash Player 9, which is about 10 times faster that Flash Player 8.

As to FUD, I ‘m the last person to spread FUD about Java, which I like on the server side. Swing is also very powerful framework, bur overly complicated. You mentioned high rates, but it still cheaper to hire an expensive Flex consultant for a month than equally expensive Swing guy for two months. In my modest estimates, the productivity doubles in Flex 2 comparing to Swing.

This is not a change just for a change. For example, I ‘d never suggest AJAX for business application, which seems to be a lot more fashionable thingy than Flex. I ‘m not jumping to the Ruby camp, which is another popular trend. But after spending 25 years developing software, I have a nose for the software with greater potential. This is not to say that I do not see the potential in Ruby. Three years from now it may be big. But as of today, Adobe Flex 2 and upcoming Apollo is the only game in town, when it comes to RIA development.

SAP is using Adobe Flex

SAP TechEd conference opens today in Vegas. The big guy is using Flex as a client for Java. Here ‘s an abstract of the presentation called “Next Generation of Client Technology for SAP “. When I suggest my clients using Adobe Flex as a front end for Java, the first question they ask is “Who else is using it “. I was answering with a couple of super heavy-weight players from Wall Street. Now I ‘ll add one more: the third largest software company in the world.

SAP is a very expensive software, and to make it more affordable, they want to offer their services ala cart. One of the directions SAP is taking is exposing more and more interfaces to their internals in the form of Web Services, and Adobe Flex client is an excelent consumer of such services.