Skip to main content
2 of 2
added 107 characters in body

There are different patterns to do that: MVP, MVC, MVVM, etc...

A nice article from Martin Fowler (big name) to read is GUI Architectures: http://www.martinfowler.com/eaaDev/uiArchs.html

MVP has not been mentioned yet but it definitely deserve to be cited: take a look at it.

It's the pattern suggested by the developers of Google Web Toolkit to use, it's really neat.

You can find real code, real examples and rationale on why this approach is useful here:

http://code.google.com/webtoolkit/articles/mvp-architecture.html

http://code.google.com/webtoolkit/articles/mvp-architecture-2.html

One of the advantages of following this or similar approaches which has not been stressed enough here is the testability! In a lot of cases I would say that is the main advantage!