The last week was a real knock on the head, waking me from the comfort of doing what I am used to do for about 3 years now – writing UI in Flex.
Why frustration? Well, I guess there are a few reasons for that, first, I am not a complete noob in the dev world, but since day one I was dealing almost entirely with Flex, yes, I have some knowledge in Java, html, some server mumbo jumbo etc. but I really am a Flex guy.
I think that beside the obvious difficulties in learning a new technology, I suffer from more profound and specific issues.
In the past years I was part of a team that set the standards of how we write client side code in my group, we decided on the architecture, gathered some helpful tools and passed the knowledge to the other developers.
Our main design pattern was the “presentation model” paradigm, in a nutshell, the pattern dictates separating the view from the business logic, putting all the logic in a presentation model (PM) class that controls the behavior and data of the view, our interpretation to this pattern was that we have the view in MXML files, and the PM is an ActionScript class that implements an interface, the view is injected with its PM by his parent view, we also used Spring ActionScript across our application for IoC purposes.
The first thing we encountered when looking into GWT was that it is focused around the MVP pattern, although the PM and MVP pattern share much of the characteristics, they are different.
In GWT, most examples and frameworks use a reversed relationship from what we did in Flex – the presentation class in GWT “knows” its view through an interface, the view is the one that implements the interface.
In first look, it seems like a nuance, what’s the big deal? Well, maybe it’s not a big deal, but it gave me a big headache J
This small difference means a completely different lifecycle of the application, it also means there is a dependency tree in the presentation layer since a presenter is responsible of creating the presenters of its view’s children (a complicated sentence, sry).
I want at least some of you to read my next posts, so I will not continue discussing the differences between the two approaches, let me just say, it took some time and effort to change the way I think about design.
I still can’t say I am completely comfortable with this new approach, but I do my best.
No comments:
Post a Comment