Friday, 31 July 2009

Head in the clouds...

Just like fashion software world has its own trends, up and downs. SOA, WebServices, had been popular quite a while. Rich Internet applications is another trend which we were introduced to Silverlight and JavaFX last year. While those topics still popular, the latest trend from tailors of silicon valley is the clouds.
It seems like cloud wars not much far. First of all whats cloud computing, the wiki definition is;
Cloud computing is a style of computing in which dynamically scalable and often virtualized resources are provided as a service over the Internet.[1][2] Users need not have knowledge of, expertise in, or control over the technology infrastructure in the "cloud" that supports them.[3]

So what's new in clouds, weren't the approach known for a long time? Why suddenly everbody building their own cloud?

First of all, cloud covers all the range from a individual developer who has a startup project which he/she doesn't want to invest in, to big firms who want scability, power and still want to delegate the administration and maintanence. Different clouds offer very different options varying from zero to full administration, zero to paid startups, own db implementation to your db vendor choice.

Besides that clouds are good choice because even getting a very basic hosting with Java is quite troublesome and expensive when compared to php and .net.
Adding a jar, deploying a new version will probably make u restart the server and ends up all the apps sharing the server with you.

Fine so far but are the clouds safe, will your data be in good hands, will your application be locked in to that environment and you will have headaches when u want to move to another?

Here are some major clouds and what they offer;

Amazon EC2
Amazon is the most mature platform among all the clouds and can offer great flexibility and is the most configurable one. Unlike others amazon lets you take the full control of the servers. EC2 offers shared disk spaces where you can install, configure, run and maintain your choice of softwares on your own virtual machine. It even supports windows, .net and SQL Server. If you want to keep the administration and setup simple they also have out of the box tools such as SimpleDB which is a schemaless db implementation just like Google's BigTable. Amazon also has a built in queue system SQS. Amazon EC2 expects you to built your services as WebServices which is good for compability and portability.
Everything looks great with EC2 including the pricing. The prices are quite standart and actually when you consider what amazon offers it may be the best deal. However, you even need to pay for the startup, which may not be the best option in all situations

Summary:
Pros; EC2, SQS, SimpleDB, S3 are all great well thought and mature services. Still if you don't find those capable enough you are free to deep dive and install your own db or vendor specific softwares.Your application won't be coupled to Amazon and will preserve portability. Good pricing.
Cons; It is not free to start so not for individual startups (which can be called as tryups :) ) without investing.

Google App Engine (Java)
I didn't even consider trying app engine when it was only supporting python but now java is supported. This is the easiest cloud to work on. Installing, developing, deploying, administring is also so easy. Just go eclipse update site download the plugin and sign up for a app engine account thats it. The plugin comes with a embedded db which is an implemantation of bigtable, and a embedded server which is an implementation of Jetty and both simulate the production environment well (not exactly but well).
App engine also offers good pricing and also its free until the application reaches the quota (which is quite reasonable). So you can even use it for free basic hosting. The biggest drawback is that it is a subset of java and doesn't offer a full relational database. So your application must be designed or modified to be able to run on App engine.
App engine shines on admınistration unless u want to control everything on your own. There is no administration, no maintanence and very little to configure.
Just like SimpleDB of Amazon, Google offers a schemaless datastore, BigTable. BigTable is fast efficient supports JPA/JDO but doesnt support full relational designs. It is a hierarchical datastore and istead of relations you need to understand hierarchical relations between entities and denormalized data. App engine is the hardest part to migrate for a standart Java Developer, however, if you succeed to understand the basics and move on, it offers fast, reliable and easy to maintain datastore. As google says Bigtable is the system which all google apps use internally, so do not need to worry about performance or design issues and better to learn how it works.
Other unsupported features are; : no threads, no network connections, no webservices, no file system writes, no java2d, no native code, no java2d but images api can be used instead. Soon support for async and queue api will be available. Besides those reflection is also limited. Reflection can be used as long as it is used for your own classes, but if your application tries to use reflection on runtime and system classes, app engine does not allow that. Actually the frameworks and librarires I tried which did not work, failed mostly because of reflection. The good side is most of them are getting patched fast to work on app engine, such as BlazeDS, Jersey, Xstream. Many well known libraries work out of the box, such as, guice, spring, aspectj,spring, grails, gwt, tapestry, jruby, jython...etc
Summary
Pros; very easy to start, develop and deploy. Great for zero startups, makes no excuse if you have a project idea. It is java!
Cons; Not whole java stack and libraries supported, bigtable needs a different approach to design than relational databases. You may end up leaving your favaourite library because it doesn't work and your application will definitely be tied to app engine.

Microsoft Azure
I would be very suprised if microsoft didn't have one, they even compete with webcam, keyboard and mouse producers. Azure is definetly a .net cloud and offers good and easy integration with visual studio developers. Microsoft is an implementor rather than an innovator for long. They are not doing bad at following Amazon. They offer their own Service bus, support web services and back ground processing.
Summary
Pros; well if you are a C#, MSSql developer it will definetly be your choice, other do not offer a lot more to convert you from the dark side (just kidding :) no offense)
Cons; well if you are not than the azure doesn't offer much to convert to dark side.

Sun Cloud
Sun's cloud is really a cloud now, but seems promising. What they plan to built seems promising, full stack java with full support to all Java standarts. They have good experience on OS with Solaris. However they can't even provide developer accounts yet (at least i have been waititng more 1.5 month). Need to wait and see, hope they wont miss the train by that time.
Pros; sun is java, they will have good support with full stack of java.
cons; it is a real cloud now (doesnt exist), and i wonder what oracle plans about it.

Actually there are some other cloud alternatives in the market such as GoGrid and AppNexus. To be honest I personally didn't have much experience on those and frankfully I would consider a big name behind the cloud, since i am going to give them all my data, application and alter my application on that cloud implemtation.
So far it seems Amazon is good for a full java project built on web services which has a budget. However, Google App Engine is great if you have zero startup and no problem on building it on BigTable and it also offers very fast development. Of course Azure is great if you are on .net side...
So there is a cloud for everyone..

Wednesday, 22 July 2009

JAXenter in English!!

..and the day come. JAXenter which used to be an only german site, is available in english now. It is nice to know such a resource is available now. Actually another suprise for me was seeing our article which we wrote with Yunus after the eclipse democamp presentation.
Don't forget to bookmark and start following JAXenter and by the time you stop take a look at our article too which we did not published or plan to publish here.

http://jaxenter.com/articles/09/Flex-Client-Applications-with-Spring-JavaEE-Web-Services-and-Flex-Remoting.html

Thursday, 16 July 2009

Flex Source Code Formatter

From the beginning of my first Flex experiences I was suffering from that there wasn't any source code formatter of Flex Builder. Using Eclipse, I can format the source codes by only one right click.



















But I was not able to format the source code of the Flex classes, components, mxmls... etc.
Today I searched about this topic in Google. And I found a plugin which can be plugged into Eclipse and formats the flex source codes.

The process list you should do is below:
1. Download the plugin.
2. Extract the files into the "C:\Program Files\Adobe\Flex Builder 3\plugins" directory. (Or your set up directory)
3. Restart the Flex Builder (or Eclipse if you are using Flex Builder as a plugin)

When the Flex Builder is restarted you will notice that 5 buttons will appear on the Toolbars Menu and two items on right click.


You can find detailed information about this tool at Flex Code Formatter.

In my opinion after formatting the source code, actionscript code segments looks nicer than mxml code segments. (P.S. : I only use it for actionscript codes.).

There isn't much people around me using this kind of tool and I am waiting for your comments after using this tool. I hope it will be a useful tool.

Welcome Incubator Authors :)

I proudly announce our new incubator authors Yusuf and Aytek. Yusuf is Yunus's brother who also has much experience with flex and Aytek is an old friend who is experienced on iPhone and Objective C besides Java.
Welcome everyone looking forward reading your posts...

Tuesday, 14 July 2009

Adobe Flex MenuBar Component


This MenuBar component allows you to create 2-level menu bar in your Flex applications.

The component takes a dataProvider as an argument just like the MenuBar component provided
in Flex platform. But this component just takes dataProvider in XMLListCollection.

In the sample application, menuitem object contains label, requiresLogin and data fields.
  • label field is the displayed text for the given menuitem,
  • requiresLogin field keeps the information whether the given menu item needs login operation or not,
  • data field is used as the id descriptor of the given menu.
When creating a collection of menuitems, give unique data field values for each menuitem.

In the given source code of a sample project, you will see GradientCanvas and GradientHBox components. They are just used to give a gradient for the menubars.

MenuBarEvent keeps the clicked menuitem id, and the information whether the clicked menuitem requires login operation or not to enter that menu.
MenuData, MenuHierarchy, SubmenuData classes are just used for data structure of the menu bar.

Moreover, you will find Gray and Green css files used for the visuality. They are just samples to demonstrate how to give gradients of the menubars, selected menu item color, etc.

Monday, 13 July 2009

Yes, Microsoft produces nice mouses...

I really wonder if that would be all we will be saying about Microsoft in few years time. I have been a computer user since Commodore 64 and all these while Microsoft was a growing company which became a real titan. Didn't they make mistakes, of course they did but every time they know how to strike back. They missed multimedia (commodore amiga had cd drives at the time microsoft didn't have real windows) later they set the multimedia standarts, they missed the internet startup, they hit back with explorer, they missed visuality they hit back with xp, they missed java (actually they just couldn't control) they return with C#, they missed ICQ later dominate with msn, they missed game console era they became the nightmare of sony with xbox (thanks to ease of development and cheap hardware), we can add much more examples such as MS Sql, windows nt... etc. I remember once they even took control of Apple. Microsoft hasn't been the innovator for long but they really know how to observe the trends and strike back. They started producing mouses, keyboards even webcams... anything you can imagine related to computers.
But I have never seen Microsoft loosing blood in many fields that fast. They seem like failing anything they have been doing since Bill went to enjoy his life. I just checked Google Analytics, I know this can not be all exact numbers but still very interesting...
Firefox leading woth 60-65% in browsers and most interestingly second place is Chrome! with about 20% and Explorer comes third with only around 12%. Can you imagine a browser shipped with the operating system (since most people don't even think about installing another) is getting so low usage. In operating systems Microsoft is still dominating around 76% where apple can only get 13% and linux following about 10% (also keep in mind windows has more illegal installed copies than mac os). However the reason is not really because of Windows success. Apple is demanding very high prices, and most pcs are already shipped with Windows installed so most people don't even bother to give a shot to linux. Linux is running fast, they also had a good acceleration with netbooks. My mum who refused to use openOffice a year before is now using a netbook with linux and open office! Microsoft may think the pc vendors are quite happy with the deals but with such a progress in linux world they may start to cancel the deals and once the pandoras box is open nothing can stop it and if Microsoft lose the advantage of bulk vendor licensing not much people will left buying licences from them. They already lost enterprise software development to Java, mobile world to iPhone and internet to google...
What can they do? well Microsoft really needs a premium class OS which can compete with Mac OS in term os visuality, easy of use with features like multi touch support etc...(which i dont think Winows 7 can!!) They may work with PC manufacturers to produce standartized and high quality hardware with great integration and compability woth the OS. Meanwhile they need to have a stripped down version of Xp for daily, business and netbook users who want performance overall everything. This version may be open sourced and even distribute free or cheap so that they can maintain their community. Google is also coming with their OS and there are many easy to use and successfull linux distros. They need to have cheap, open, fast but also a stable OS which Xp can be a candidate.
Microsoft has a great advantage, since Java is now backed with a vendor like Oracle now they can open their development platforms and form their community. They are not alone in the playground any more so they need to accept the rules. They must open their standarts and accept other standarts. Windows mobile is in ruins, they must realise thephone fuctionality is priority and the device should be capable besides that (not like the currecnt heavy unstable OS with poor phone fuctionality).
Google is smart and doing great, they are taking Java into another level and building mant tools, services and facilities for people. While doing that they also make everyone believe they are not evil. They also do things for profit but they know how to make indirect profit which microsoft also needs learn.
If not??? well google and apple will take over the world with new tech OSs, computers, cloud computing, sdks, mobile devices.. and Microsoft, well probably people will say they produce nice mouses...
I am not an enemy of Microsoft, I want them to stay alive so their competitors can keep their quality, so this is a open letter, start innovating and generates less direct revenues..