June 20, 2010

Learning Scala

As a man who try to follow goals of pragmatic programmer, learning Scala is one of investments in my portfolio and new language this year, as well.

I am a man of practice. Therefore, I like to learn is from examples. Brute force exercise of this principal is "Learning Scala in small bites" blog, as well I place I would recommend for start. To be able to remember or comprehend things, I always try to pass through fingers all I read. This case was no exception. To be honest, I didn't follow this rule all the time :)
Now when I poisoned my brain with a bunch of raw information, next move was to spice it with some explanations and more usable examples. Next address was IBM and "The busy Java developer's guide to Scala" series of articles by Ted Neward.

So far, I like Scala a lot. One of those languages that caught me on the first site. I have no experience with functional languages, but how Martin Odersky has incorporated its principals into object-oriented world is something I grasped(?) very easy.

UPDATE: Upffff. This is THE challenge! Just when I thought I'm moving/learning fast, an totally non-understandable example hit me in the face:)

March 22, 2010

What if I don't care for Flex Builder?

"Everyone" point out how $299 for CFB is a good deal because you get Flex Builder bundled. But what if I don't care for Flex? Is it still a good deal?

Flex Builder Standard costs $249 and CFB+FB $299. What is a real idea behind this? To promote CFB among Flex developers? Honestly, I see this as a better deal for Flex developers, who really needs an IDE for rapid development, then it is for CF developers (only).

Me, as CF developer, don't see this as a good opportunity at all. Opposite. 83% of money I'll pay, actually goes to something I won't use.

On the other hand, by supporting this project, we keep doors open for version 2 one day. And when that day come, I hope that CFB will be sufficient argument for itself to have decent sale.

Update:

Simple math:
Flash Builder 4 Standard (stand alone) - $249
CF Builder 1.0 w/ Flash Builder 4 Standard included - $299
--------------------------------------------------------------
-> CF Builder 1.0 costs $50

Related content:

March 16, 2010

BlazeDS: Creating endpoint at runtime

Why? Because I do not want to bother end users with xml configuration files. Simple as that.
Biggest enemy of your application is user itself. Therefore, reducing possibility to make a mistake is most important goal if you wish to left good impression with your app. This was one of steps that I take on the road to make Collyba installation procedure as easy as possible.
As I said in previous blog, while I was working on this, insight  to BlazeDS source files was of great help. Actually that is where I found a solution.

What are channels and endpoints?
Channels are client-side objects that encapsulate the connection behavior between Flex components and the BlazeDS server. Channels communicate with corresponding endpoints on the BlazeDS server. You configure the properties of a channel and its corresponding endpoint in the services-config.xml file.
But in our case, we won't configure it in XML file but programmatically.

BlazeDS: Creating destinations at runtime

Because it is already said a lot on this subject, I won't waste much words, but go straight to the point/code.
/**
* Create blazeds destination at runtime. Follow SVN link to java source files for more details.
* @name hint="Destination name" 
*/
function createDestination(destname,channelId){
 var local = structNew();
 
 //svn: http://opensource.adobe.com/svn/opensource/blazeds/trunk/modules/core/src/flex/messaging/MessageBroker.java
 local.brokerClass = createObject('java','flex.messaging.MessageBroker');
 local.broker = local.brokerClass.getMessageBroker( javacast('null','') );
 local.service = local.broker.getService('message-service');
 local.destinations = local.service.getDestinations();
 
 //check if destination already exists. If it does just return it
 if (structKeyExists(local.destinations,arguments.destname)){ //check if destination already exist
  return local.destinations[arguments.destname]; 
 }
 
 //svn: http://opensource.adobe.com/svn/opensource/blazeds/trunk/modules/core/src/flex/messaging/Destination.java
 local.destination = local.service.createDestination(arguments.destname);
 // Creates a ServiceAdapter instance and sets its id, sets if destination  is manageable
 local.destination.createAdapter('cfgateway');
 
 //svn: http://opensource.adobe.com/svn/opensource/blazeds/trunk/modules/common/src/flex/messaging/config/ConfigMap.java
 local.configMap = createObject('java','flex.messaging.config.ConfigMap').init();
 local.configMap.addProperty('gatewayid',application.CFEventGatewayId);
 
 //svn: http://opensource.adobe.com/svn/opensource/blazeds/trunk/modules/core/src/flex/messaging/config/ServerSettings.java
 local.ss = createObject("java","flex.messaging.config.ServerSettings");
 local.ss.setAllowSubtopics(true); 
 local.ss.setSubtopicSeparator('.');
 local.ss.setDurable(false);
 
 local.destination.setServerSettings(ss);
 
 local.adapter = local.destination.getAdapter();
 
 //Initializes the adapter with the properties.
 local.adapter.initialize('cfgateway',configMap);

 local.destination.addChannel(arguments.channelId);
 
 //Starts the destination if its associated Service is started and if the destination is not already running. 
 local.destination.start();
 
 return local.destination;
}

March 7, 2010

Deploy ColdFusion 8/9 on Glassfish v3

Deploying ColdFusion 8/9 on Sun Glassfish 3 is not much different than it is on IBM WebSphere 7 AS. Except, imho, it is far more optimal, because it takes much less resources (especially if it is setup for dev) and cost nothing. I did this on Win7 platform, but it looks completely the same on Linux platforms. So, let's move.

March 4, 2010

Proud to be second!

Not that I wouldn't like to be a first, but last 2 second places were awesome!
On 29th January I won second place on "Best Of CF9" contest. Contest was  organized by Ray and other Adobe Community Experts. Thank you for that. I won't talk about much about that here, just to emphize that I have "big" plans for Collyba. "Big" actually means that I'm really going to continue development on it, which is, for itself, enormous accomplishment:)

February 17, 2010

What is MVC in few simple words

Today I read an excellent post on FW/1 mailing list. My impression came from ideal I try to follow in my life: "perfection lies in simplicity". I was, several times in situation to try to explain people what MVC (framework) is, and discovered that unexperienced developers have a problem to chew up that subject. One more thing I am sure about is that usually it is a problem with how things are presented more then to whom they are presented. However, this man, Ryan Cogswell, did it in 5 simple sentences. So, for everyone who are still not clear what MVC framework is and how it works, and for me who will use his words to explain others, I'll quote:

January 9, 2010

Everything is dead these days


Sounds morbid, but, really, in last few weeks everything died :)

As a ColdFusion developer most noticeable to me was spree of articles & blogs which tried to explain how CF is dead (or is about to die). But that's something I used to. Each time new CF Server comes out, "CF-is-dead wave" hit the coast. What really surprised me was that everything else died.

Few days ago, I read an "old" (for some reason it became popular again) article how UML died and 13 reasons why is so. According to author, this technology is already dead. After reading it, my only question was: What is an alternative? Read a blog, read dozens of comments and no one suggested what can be an alternative to this.