kyky is the new Component Design Champion
Friday, June 29, 2007
After three days of on-site finals, kyky emerged as the winner of the 2007 TopCoder Open Component Design competition, taking home the top prize of $25,000. bendlund took second place, and oldbam took home the third.
Wednesday, June 27, 2007
We've all had problems with sending files as attachments through email. Either the attachment is too big or the email server has some crazy antivirus system that will not let your attachment through. The File Delivery component (or better said, application) comes to address this problem. It is basically a Web base file storage solution. You can go to a site where the application is installed, upload the file you want to send, and then specify the email address(es) you want it to be sent to. The recipients will receive an automatic email with the URL of the file. There are also nice features such as receiving notifications when the recipients actually download the file and you can also say when the file will expire.
From a design point of view this application is not hard but there are a lot of things that need to be done. There are servlets for upload and download, there is an email notification system and there is also database persistence because the application needs to keep track of expired files.
The best submission managed to address all the requirements properly and also took into consideration performance issues (handling huge uploaded files efficiently). Some added additional functionality, such as the ability to view a history of the uploaded files, and support for authentication in the future.
Thursday, June 28, 2007
The Generic Application Service Processor (GASP) component provides a service framework for applications, which allows the decoupling between the presentation and business tiers of an application. The customer of a service will use a concrete Event in order to invoke the service. He can pass the custom arguments using the Payload property of the Event. The user will interact only with a service processor delegate, which has the ability to look up the service processor (similar to how the Context is looked up in Java).
The GASP will look up the concrete service implementation based on the ID and version of the Event and will invoke the service. The invocation can be performed inside a transaction and this component will provide at least one implementation of a transaction management mechanism. The result of the service invocation will be returned to the user inside a ServiceResponse, in the Payload property. The user will also have the possibility to simulate a session between multiple invocations of different services by reusing the same EventContext for subsequent service invocations.
Implementing the design for this component was quite straightforward, as the notions needed for the framework were identified and well specified in the requirements. One place where the designers had to be creative in order to achieve the requirements was in the transactions area.
For the Java version, there are multiple technologies that could be supported: EJB, Spring, and so forth. For the .NET version, the usage of TransactionScope was quite straightforward. The designers also had a challenge in choosing the way to look up the service processor and the way to invoke the services. These could have been done locally (using direct method calls) or remotely. There was one interesting approach which uses MSMQs in order to look-up the service processor remotely.
This approach has the advantage of working remotely, but it has the drawback of a possible overhead introduced by the queues. Another interesting aspect inside a submission was the possibility to map the service to normal methods, similar to how web services / web methods work.
Friday, June 29, 2007
DB Converter is a command line tool which provides the functionality to convert a database structure from one database to another. Since the concrete design of different database systems vary a great deal, the component will only cover the configured / pre-defined parts of the database structure, and log all the things not successfully converted into a file. The initial version supports database objects including Table, Column, Keys and Index.
The very first thing to consider before starting the design is to define a set of metadata to store the database structure, then two main procedures should be designed, one is to pull out the structure / objects of a database and convert it to the metadata form defined before, the other procedure is to convert the metadata information into DDL which can establish the structure in the destination database.
The basic requirement is not hard to fulfill, but making the whole design clean and easy to understand is not a trivial job. More specifically, how to define the metadata and the configuration format is important for flexibility and extensibility consideration. Some of the competitors deal with this problem elegantly and provide clean design which is easy to extend and can accommodate further requirements.
Component Design: Scores & Wagers