Friday Sep 12, 2008

Jemos LTD was founded

Hi, on the 9th of September 2008 Jemos LTD was founded. I started this business activity with the intent of providing a structure around the numerous initiatives which are being created around Jemos. If you need consultancy services, Java contracting work, please do contact me. Jemos Ltd provides a broad and deep knowledge in Java Services (both core and enterprise), in client facing consultancy, Project Management, Business Analysis and in all aspects of the SDLC. 

Wednesday Aug 06, 2008

JECO - JEmos COntainer is bourne - check it out!

I created a standalone Spring Container called JECO (JEmos COntainer). You can find the extensive documentation and the code here.

JECO offers to any Java developer a standalone Spring Framework. This means that you won't have to deploy Spring within Tomcat or JBoss but you'll be able to run it from the command line. Moreover, JECO is centered around JMX architecture, with its central component being a MBean Server, exposed remotely.

I encourage you to download it and try it. JECO is fully open source and runs under the BSD Open Licence.

Feedbacks are welcome.

Regards,

M. 

 

 



 

Sunday Jul 06, 2008

E-mail verification with Flex 3

Hi, I spent most of my Sunday applying email verification validation into my Flex application. I just wanted to share my experience, so that this can come useful.

My component is a simple Feedback form, which contains two TextInput components within a FormItem. The two components look like the following:

 <mx:FormItem label="Email address">
              <mx:TextInput id="emailAddr1" width="216" />           
 </mx:FormItem>
 <mx:FormItem label="Email address confirmation">
            <mx:TextInput id="emailAddrConf" width="216" focusOut="this.validateEmails(emailAddrConf, event);"/>
 </mx:FormItem>

I had the necessity to add a validation by which if the two email addresses were wrong a ToolTip was displayed indicating the error. I decided to activate this functionality when the user moved the focus out from the email verification TextInput. The AS3 function which gets invoked checks if the text of the two email addresses is the same and if not, it creates a ToolTip, vestes it as an error, and displays it. Meanwhile, another custom validator doesn't enable the submit function until all conditions have been met. The morale of this function is that if the two emails addresses are different the tooltip is displayed, otherwise is set to invisible. I have also added the code to set the tooltip is not visible in a resetForm() function invoked when things have gone ok or when the user clicks ok. This is the function:

 

private function validateEmails(event:Object, fEvent:FocusEvent):void {
               
                var errMsg:String = "Emails don't match";
               
                if (emailAddr1.text != emailAddrConf.text) {
                   
                    if (emailErrorTip == null) {
                       
                        var x:Number = fEvent.currentTarget.x;
                        var y:Number = fEvent.currentTarget.y;
                       
                        trace(x + ":" + y);
                       
                        var pt:Point = new Point(x, y);
                        pt = emailAddr1.contentToGlobal(pt);
                        emailErrorTip = ToolTipManager.createToolTip(errMsg, pt.x + 50, pt.y) as ToolTip;
                        emailErrorTip.setStyle("styleName", "errorTip");
                       
                    }
                    emailErrorTip.visible = true;                   
                } else {
                    if (emailErrorTip != null) ToolTipManager.destroyToolTip(emailErrorTip);
                }
               
            }

 One thing to be careful here is not to create the tooltip again if it already exists. Especially if you would invoke this function on an event which occurs often, Flex 3 would create tons of tooltips with consequent degradation in performance and (in my case) an error due to refresh not being too fast. This said, for the email and other string text inputs in the form there are also the standard validators (e.g to check that the email address is correct or that a text input field is not empty).

To see the code in action (and if you want to leave a feedback for this article) you can visit http://www.jemos.co.uk and click on the 'Feedbacks' link.

Good software to everyone!

 M.

 


Saturday Jul 05, 2008

Playing with Terracotta now!

Hey, recently I came to discover Terracotta. On Friday I bought a book and now I'm going through this technology, which looks promising. Well, the first impressions are a mixture of feelings. On one side, Terracotta seems very good simply because it works at the core of the Java technology, that is at the JVM level. This avoids the classic problems of serialization or replication through database storage. It also promises to deliver transparent clustering semantics, by delegating everything to configuration instead of code changes. But then one needs to think its application from day 1 with clustering/caching in mind in order for Terracotta to help. There is the concept of roots, which are basically the root of object graphs which will be clustered. And it's clear that Terracotta favours Collections for clustering/caching, which may not be in the mind of the original application's designer.

More on this later folks!

 

M.