Fernando Correia’s Weblog

August 31, 2008

Verbs are better

Filed under: Software Development — Fernando Correia @ 4:35 pm

On user interfaces, verbs are better than exclamations.

MikeWhoBikes wrote an article explaining how you can improve the usability of your applications, based on this example:



Filed under: Software Development — Fernando Correia @ 2:23 pm
Tags: , ,

I have another website to build. Last time I used Drupal, and it is certainly a good tool. Since I am learning Python I went out to find a good CMS in that language and I found out that Plone is a major one.

It is really an advanced tool. It’s easy to install, have a powerful user interface and can be extended in Python in an object-oriented way.

There is a page with some great screencasts that show what Plone can do. I recommend the second one, Editing with Plone. It is 12 minutes long.

After seeing it, I decided to spend some time to learn more about Plone.

August 30, 2008

Scripting universe

Filed under: Software Development — Fernando Correia @ 6:33 pm

The Industry Standard has published a long interview with dynamic language luminaries about the state of these languages. It is clear that dynamic languages are gaining importance.

Some quotes from the article:

“Since 2005, there haven’t been any singular events that changed the way scripting languages are used or their capabilities. They have evolved (more in perception than in real capability) from a place where they were used only for simple tasks or prototyping of new systems into much more general use.”

“In general, it’s easier to create and change code written in a dynamic language. Much of the Web has traditionally been created using dynamic languages, from Ajax on the client to server code written in PHP, Perl, Python and Ruby.”

“Breaking the 3GHz barrier on this architecture-and now pushing 4GHz-has sped up dynamic language code to the point where many algorithms that simply weren’t feasible to implement in PHP are now possible on commodity hardware.”

“People seem more positive towards scripting languages. They have, over time, come to realize that their performance is such that they work for most problems and have also learned that the compilation step can be heavy-handed and a huge time sink in the development cycle.”

“These days, it boils down to which dynamic programming language to use, not if you should use one.”

“Nowadays, every major scripting language has decent integration with every major Ajax library.”

“You can always throw more hardware at a problem, but getting something solid out on time is key, and dynamic languages provide great leverage to succeed.”

“First and foremost, scripting (dynamic) languages are here to stay. Dynamic languages better support an adaptive/iterative development model, and so are of increasing importance in the fast changing IT landscape of the early 21st century. They provide an excellent complement and often a better outright replacement for systems languages (such as Java, C++ and C#).”

Read the complete article at The state of the scripting universe.

August 29, 2008

Utility Mill

Filed under: Software Development — Fernando Correia @ 7:19 pm

Almost every day I’m amazed to see how Python inspires people to build great stuff.

One example is Utility Mill. It is an application that lets you easily build Web utilities. These utilities have Web pages so you can interact with them. But they also have a RESTful API so they are actually Web services.

The utility can accept input in the form of parameters, process this input with arbitrarily complex logic written in Python, and output the results in several formats like text, HTML, XML, JSON or files.

I recommend the brief video tour and the Maze Generator as an example.

Now, that’s a quick way to publish a Web service if I’ve ever seen one!

August 27, 2008

A PHP developer looks into Django

Filed under: Software Development — Fernando Correia @ 9:15 pm
Tags: , ,

Thierry Schellenbach has published a very interesting article about his study for selecting a Web framework. A PHP developer that values the Symfony framework, after weighing the issue along with a colleague he decided that for many projects Django and Python are a better fit than Symfony and PHP.

This is not a typical holy war rant. He points where Symfony has advantages over Django. But concludes:

Both are great, but Django more so.

August 25, 2008

Get out of that sandbox

Filed under: Software Development — Fernando Correia @ 2:15 pm
Tags: , ,

Brian Clapper just published an excellent article about Making XML-RPC calls from a Google App Engine application.

He demonstrates how we can live with and work around limitations of a sandboxed environment like Google App Engine.

I also liked the way he shows how the good design of xmlrpclib makes it easier to adapt it to other needs.

Latency is Everywhere

Filed under: Software Development — Fernando Correia @ 1:05 pm

Latency… I thought I knew about it. But not enough.

Latency in applications is a very complex subject and its management is not a solution, but a process.

Todd Hoff published a very interesting article that summarizes the subject and points to many helpful resources.

August 23, 2008

Example of RIA in the cloud

Filed under: Software Development — Fernando Correia @ 12:34 pm
Tags: , , , , ,

When I decided to learn and get some first-hand experience about Rich Internet Applications (RIA) and distributed application hosting (cloud computing), I chose to do it using Flex and the Google App Engine. Flex is a mature tool that has a plethora of rich interface capabilities and is very good to connect to services on the Web. And the App Engine is a very intriguing proposition where you use Google’s infrastructure to run your application.

To share my experience and get some feedback I started a project called “Flex and Python Test”. Now this project is finished and released. The application is a very simple project portfolio that can keep a list of projects and participants. The data is kept on the client for fast response, and the modifications are sent to the server for persistence. This is what the application looks like:

The source code for this application is available on github. If you want to understand it, download it and browse the code. To help, I will explain a bit about the design.

This is the general architecture:

The client is a Flex application running in a browser. Flex allows us to have a rich interface without dealing with incompatibilities between browser implementations. The server is a Python application running in Google App Engine. The client send requests through HTTP using the AMF encoding format. This is a binary format that is very efficient for Flex applications. The server processes the requests and sends responses also encoded in AMF. The server exposes its interface in the Remote Procedure Call (RPC) pattern.

If you download the source, take a look at README.txt. It explains how to run and deploy the application. There are three directories: flex-client contains the Flex application that will run in the browser. python-client contains an alternate client in Python that you can run in your computer to initialize data, test the service and learn the API. server contains the Python service that is deployed to Google App Engine.

To build the Flex client I decided to use a Model-View-Controller (MVC) framework. A sound structure helps when you want to build larger applications. After experimenting with Cairngorm, I went for PureMVC. If I would make another iteration I might now try Mate.

With PureMVC, this is the overall architecture of my client application:

The Model represents the data. It uses the Proxy pattern to control access to the remote service. The View contains the user interface. It uses the Mediator pattern to implement Supervising Presenters that manage the interface components. The Controller contains business logic. It uses the Command pattern to execute actions that interact with several other components. The model, view and controller objects communicate using a Publish/subscribe-style Observer notification scheme.

For instance, this is how the Participants proxy asks the server to insert a new participant:

public function addParticipant(participant:Participant):void
        new Responder(onAddParticipantResult, onFault), participant.toDto());

On the server side, Google App Engine takes care of executing your application when it receives requests. The Python application uses PyAMF to decode the client requests and execute the service operation that is being called. The data that is transferred between the client and the server is stored in Data Transfer Objects (DTOs). Since both Python and Actionscript are dynamic languages, I didn’t declare formal type structures for these DTOs. They are just dynamic objects. The service operations use App Engine’s Datastore API to store and retrieve objects.

This is how the ProjectParticipants service executes the operation to insert a new participant:

def save(self, participant_dto):
    if hasattr(participant_dto, '_key') and participant_dto._key != None:
        return self.update(participant_dto)
        return self.insert(participant_dto)

def insert(self, participant_dto):
    participant = ProjectParticipant()
    participant.project = Project.get(participant_dto.project_key)
    participant.name = participant_dto.name
    return self.to_dto(participant)

Some of my previous posts have more details about how I built this application:

I’ve deployed this sample application to Google App Engine. You can interact with it using this URL:


Click on Edit projects to open the RIA client. If you refresh the homepage you should see the updates you made.

I hope this can help other people who want to learn some of these techniques and tools. Your feedback is most welcome.

August 22, 2008

Read it Later

Filed under: Software Development — Fernando Correia @ 7:35 pm

I read a lot on the Web. I use it to keep up-to-date on current events, to learn about new technologies and tools and to research solutions that I can apply to my work.

When the computer is busy, for instance compiling a project, I browse a website and open a few links on several tabs. Sometimes there is an interesting article that is longer than usual and I can’t read it at that time.

Now there is a plugin for Firefox that helps me save them to read later. It is the Read it Later Firefox Extension.I works remarkably well and is very easy to use.

If you read a lot on the Web and use Firefox 3, give it a try.

Tools for Web design

Filed under: Software Development — Fernando Correia @ 9:01 am

I’m doing some website design and I found some helpful tools.

RoundedCornr can help you create rounded corner elements in your page. It also makes rounded buttons and tabs.

colorcombos helps you pick your website’s color scheme.

There is also some useful sites that list several tools that can help you:

Web 2.0 Design Generators For Developers: “a handy list of online tools to help you save time and effort creating nice graphics for your sites or apps.”

25 Rounded Corners Techniques with CSS: “some quality and usable rounded corners with CSS techniques for you to have the best choices.”

Next Page »

Blog at WordPress.com.