Category: applications

Why not use RESTeasy to create REST services?

Posted by – February 9, 2009

After few days using RESTeasy in my project I found a very annoying issue related with its Spring support, please consider the bean declaration below:

<bean id="remoteAuthenticationService" class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">
    <property name="serviceUrl"
    <property name="serviceInterface" value="com.fastsearch.esp.admin.RemoteAuthenticationService"/>
    <property name="httpInvokerRequestExecutor" ref="executor"/>

For some reason the RESTeasy ContextLoaderListener implementation is unable to resolve property placeholders used by some properties of beans at singleton scope, when I read these properties from my bean logic I see all properties placeholders there as they weren’t resolved.

So I decided to try Jersey since it uses the standard implementation of ContextLoaderListener that comes with Spring, now my application works as expected, all properties placeholders are being correctly resolved on my Spring singleton beans.


Changing field widget attributes from view code

Posted by – February 3, 2009

Yesterday I finally wrote my first Django application, this application is a basic crud that contains two pages, one to list costumers and another to change costumer data.

My biggest challenge was related with some form features, with Django forms you can programatically create a view form that contains several fields with its constraints and optionally associate a Django widget with this field. Django forms also have a very powerful validation engine and some form field constraints must be defined for this purpose.

This application uses the same page for two purposes, to add new data or edit data, in this scenario I must use a hidden field to be used as flag indicating in which mode the page is, adding or editing data, I must also change the readonly attribute of input widget used by costumer id form field since the user can’t change costumer id.


Rational Application Developer and Websphere Portal Express

Posted by – January 8, 2009

I just started to use IBM RAD and IBM Websphere Portal few weeks back, IBM RAD is a very complete tool built on top of Eclipse, it has a lot of features that facilitates the work on portlet development, you can create in a few minutes a portlet using Struts or JSF as framework. Once a portlet is created you can build and package this portlet as WAR file to deploy on Websphere Portal.

Websphere Portal is completely updated portal solution, you can run JSR 168 and JSR 286 compliant portlets, you also have the option to create portlets using the IBM specific implementation that contains a lot of additional features.

The entire portal is fully customizable, you can change the portal appearance by adding new themes, all portlets can be added to a portal page by just drag and drop then on a page, access control can be easily done via deep integration with LDAP. You can even use google gadgets on your portal page!

Are you worried about scalability? Don’t worry, you can put several websphere portal instances running on a cluster mode.


Objective-C number formatting with NSNumberFormatter

Posted by – December 11, 2008

Today I finished an article to a local magazine about mobile development, this article gives a small introduction on iPhone development with iPhone SDK, this article covers the development of a simple application that perform some meansure conversion. One of learned things was how to do number formatting with NSNumberFormatter like we have below:

NSNumber *result = [NSNumber numberWithFloat: 0.0];

NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
[numberFormatter setFormatterBehavior:NSNumberFormatterBehavior10_4];
[numberFormatter setDecimalSeparator:@","];
[numberFormatter setFormat:@"0.00000;0.00000;-0.00000"];
NSString resultText = [[[numberFormatter stringFromNumber:result];

In this example I’m setting the number format to show a float number with 5 decimal positions and using comma as decimal separator since this is the brazilian decimal separator. I could convert and format a NSNumber by just passing it as argument to stringFromNumber method of NSNumberFormatter instance. Not so different from Java, right?


Flexbuilder versus Silverlight Tools for Visual Studio 2008

Posted by – December 1, 2008

Last weekend I spent few hours trying to create only the interface of a timesheet application, I made two versions, one using silverlight and other using flex. For Flex I used Flexbuilder as a tool and for Silverlight I used Silverlight Tools for Visual Studio Web Developer Express 2008.

In many aspects Flexbuilder is much more better than Silverlight Tools, one of then is your design time editor, Flexbuilder has a good design editor, you can easily create your application interface by just drag and drop components inside application container, in other hand, silverlight tools doensn’t have the same facility, you must drag and drop directly in xaml code, horrible! But, but, you can solve it easily if you buy the xaml specific editor called Expression Blend. Now you have two tools to work on one technology. :D

Another big issue on silverlight tools is related with the code pane and preview pane, this two panes takes half of screen each, well, there’s a way to collapse, anyway, when you type something on code pane your editor freezes for few seconds before preview pane is updated, if you don’t want it just collapse preview pane.

Both tools lacks the same feature, a kind of context sensitive menu for each component, one of these context sensitive menus could be applied on a component like Flex grid and could be used to help on merge of cells or rows on a grid.

Click here to load Silverlight version of Timesheet.

Click here to load Flex version of Timesheet.