[Be el o ge]

I ♥ The Web

[Be el o ge]

Entries Tagged as 'Patterns'

App Arch Guide 2.0

August 14th, 2009 · No Comments

Although the App Arch Guide is coming from Microsoft and therefore there are some MS specific technology sub chapters, the thoughts about architecture are quite applicable to any other technology as well. It’s simply about software architecture in general.
I guess after the first reading I will come back to it once in a while to use it as a reference. It’s great for recalling about what stuff you should think when designing your software and which architectural possibilities you have.

  • Delicious
  • Twitter
  • Facebook
  • LinkedIn
  • Reddit
  • Slashdot
  • Technorati Favorites
  • Digg
  • Share/Bookmark

[Read more →]

Tags: Architecture · Books · Patterns

GWT MVP example online

August 12th, 2009 · No Comments

I already wrote about the great GWT Best Practices talk by Ray Ryan on the Google I/O.

Now there’s sample code for the Model View Presenter pattern online: http://code.google.com/p/gwt-mvp-sample/

  • Delicious
  • Twitter
  • Facebook
  • LinkedIn
  • Reddit
  • Slashdot
  • Technorati Favorites
  • Digg
  • Share/Bookmark

[Read more →]

Tags: GWT · Patterns

GWT Patterns / Best Practices

August 12th, 2009 · 2 Comments

I just finished reading two articles about Patterns and Anti-Patterns in the Google Web Toolkit. They’re not exactly about rocket science but nice summaries. Also some patterns are not specifically GWT patterns rather RIA patterns in general, but I don’t want to split hairs here…

Patterns + GWT + Ajax = Usability

Key points

  • Client-Side validation. In the article called “prevalidation”, meaning making an async call to the server via Ajax in order to validate input data
  • Code Sharing. Since you write your client side code in Java you can share code with the server side to a certain degree. Validation code and data objects are good candidates for code sharing.
  • Caching. GWT provides several possibilities to cache data on the client side and thus reduce calls to the server. The user has to wait less and your server has less work.
  • Prefetching. You can try to guess what data the user wants to see next. This can be very beneficial, but you be careful: sometimes the user thinks quite different than the developer
  • Thread Simulation. Javascript runs in one thread. No chance to spawn a second one. Use the GWT Timer class to simulate threads or GWT’s deferred commands.

5 GWT Anti-patterns

Key points:

  • To many Ajax calls. Solution: Use DTO’s to transfer bigger junks of data in less requests.
  • Inline Javascript. Meant are not native Javascript methods, but manually added Javascript code as a String to onclick, onmouseover, etc. attributes. The compiler can’t optimize it, debugging is hard or rather almost impossible. Solution: Use GWT’s event handlers.
  • Listeners instead of CSS Pseudo Classes. Solution: Sometimes it’s more effective and efficient to use CSS Pseudo class instead of GWT Listeners. CSS is easier to change, to deploy and faster because it’s handled by the browser, not the browsers Javascript engine. But be aware of browser differences, specially if you have to support IE6.
  • Window.alert: Window.alert and async calls don’t go well together. Just don’t use it. Plan some area in your application which displays the error and warnings.

The article mentions a fifth anti-pattern: FlexTable. FlexTable is a powerful GWT class to display data which is supposed to be displayed in … well… rows and columns. Additionally to this obvious usage it’s used to layout applications and that is what the above article criticizes. If you look to the comments on that article you’ll find the typical flame-war CSS-based layout vs. table-based. In my opinion it just depends very much on the use case, therefore I wouldn’t go so far to call it an anti-pattern.

  • Delicious
  • Twitter
  • Facebook
  • LinkedIn
  • Reddit
  • Slashdot
  • Technorati Favorites
  • Digg
  • Share/Bookmark

[Read more →]

Tags: GWT · Patterns

MVC vs. MVP

May 18th, 2009 · No Comments

Ich bin gerade auf folgenden hilfreichen Post gestoßen:

MVC or MVP Pattern – Whats the difference?

  • Delicious
  • Twitter
  • Facebook
  • LinkedIn
  • Reddit
  • Slashdot
  • Technorati Favorites
  • Digg
  • Share/Bookmark

[Read more →]

Tags: Patterns