Monday, November 28, 2005

Do Models Wear Deoderant

part. 3. - Rails

Well, I reached the end of the technology, calling osatnimi blush at times of major developers of web applications. It is, of course, Ruby on Rails - the framework, which has a chance to become the most popular application skeleton ever. Web applications are a particular type of software. Many tasks that the programmer must perform repetitive - from the creation of a mechanism dispatchującego, through the actions, views and model.

Rails comply with all the basic requirements which are placed skeletons with modern web-applications. It can thus benefit from the controllers and templates. You can also use OR mapping and web interfesów serviceów (it's probably not often met in typical frameworks).

So we have finished writing a self-contained solution for small, medium and even large webaplikacji - no need to use the EXTERNAL libraries such as sending emails or database operations.

Ruby on Rails is the framework with a very strong support for Ajax. We have a set of commands that significantly reduce the time to write a truly interactive applications. But what makes Rails falls in love with an increasing number of developers once convinced of the power of Java? PLEASURE From planning and time that must spend VALID FROM THE POINT OF VIEW OF THINGS YOU.

In the next post I will describe briefly my first day of project creation Communities Website System, which is just written in Rails.

Tuesday, November 15, 2005

Sorority Initiation Movie

method for automatic updates, Rich Internet Applications with Ruby

recently intensively dealing with the creation of Rich Internet Applications. Most of these programs written in ActionScript 2.0. For the last week, however, dealing with writing small applications in RubyOnRails using libraries javascriptowych of asynchronous requests (ie AJAX).

main problem every programmer aplikacji WWW jest napisanie czegoś co nie będzie generować dużego ruchu w sieci. Pisząc RIA nie można się przed tym uchronić. Niestety model HTTP nie jest zbyt odpowiedni do tego typu aplikacji - o wszelkich zmianach w bazie danych klient dowiaduje się dopiero po wysłaniu żądania.



Przykładowo mamy prostą grę www, w której ruchy jednego gracza są obserwowane przez drugiego. Załóżmy, że gracz 1 co kilkanaście sekund dokonuje ruchu. Natomiast gracz 2 chciałby od razu widzieć co się wydarzyło. Teraz pojawia się problem - aby coś takiego uzyskać trzeba na przykład w odstępie 2 sekund wysyłać zapytania typu GET to the server to see if there was a movement in general. Assuming that the nearly empty GET request + response from the server consumes about 4kB (total return) so we 2kB / s for one player. If you have a link, say, 1 Mbit (~ 128kB), we are able to handle only 64 users at once (!). But keep in mind that we can have even two seconds slip with the present data.

lot about this problem and thought came to mind only solution for the creation of your persistent connections in both directions. However, today's firewalls or proxy servers will not let ... We must therefore stick to the HTTP protocol ...

But I came to solve the problem: D I do not know whether it is adequate and that certainly would work. However, I know that this is the best of my current practice ... : D

trick is to create nasłuchiwaczy. Nasłuchiwaczem is simply a client who wants to learn about changes to selected parts of the database. The client connects to the server while the server sends its response right away .... connection so the "hanging" until the one of the players will change some data in the database. When hanging thread receives this information - it generates a server response, then terminates the request. Nasłuchiwacz info gets so right away when the data has changed. When something like this nasłuchiwacz reconnects to the database because he wants to listen to again change.

solution is primarily an ideal, due to the fact that it works over HTTP. The only problem is timeouts. For example, proxy servers can wait a certain number of seconds to answer, then a disconnect. Then the customer has something to capture and connect again (of course, server-side hanging topic must also be removed.)

What do you think about this rowiązaniu? Is there any other contraindications to use such techniques?

Wednesday, November 9, 2005

Bells Palsy In Arm And Leg

beginning part. 2. - RDT

course on learning started to look for a decent development environment. To my surprise it turned out that the best environment is written in ... yes yes ... beloved Eclipse: D

Ruby Development Tool, because it is the name of this plugin has many features Javovego JDT. Of course, it is far advanced capabilities JDT, however, has a basic functionality that can greatly facilitate implementation beginner and intermediate Ruby programmer zaawnsowanego.

So we have things like: quick assist (ctrl + space), outline view, debugger integrated with the eclipsowym, gui testing unit is almost identical to javowego JUnit, syntax highlighting and checking on the fly.

project in recent times faster evolving, therefore we can count on you to quickly add new functionality and improve the bugs.

Wednesday, November 2, 2005

Fun Brain Poptropica .com

Beginnings with Ruby part. 1. ODBMS vs

We recently fashion for Ruby - great scripting language by Yukihiro Matsumoto. On most blogs every 5 javowców topic concerns Ruby or Ruby on Rails . I decided to see what this genius is in itself is a scripting language, and I started to learn it.

Ruby is a breakthrough in object-oriented programming. It is the language in which everything is an object. There is no simple types like int, long or double in Java. Each variable, and so has the value of properties and methods. However, this is primarily a dynamic typing language - no need to define a type of object or project types. There is a lack of interfaces are for this module. We have highly developed mechanisms for iteration and blocks of code which are callback (called callbacks). It is a language with a very brief notation - with success on a single screen can be opened two editors side by side (in Java monitor is not enough for one;). It all makes can be programmed quickly and painlessly - in accordance with the principles of Agile Programming. The idea of \u200b\u200bthe authors, is to make programming in Ruby feel the true pleasure of programming.

The following Topics will try to bring the good side (and perhaps the wrong side) programming in Ruby.