Let me be clear: I'm not suggesting that any particular version of a presentation layer is "the right way". Different environments call for different patterns. What I was suggesting with the app state in the view thing was that if you allow model objects in your view it makes the mistake of managing your state in the view much easier to make. There is one instance where this pattern was violated in the project I'm working on, and it has caused a lot of bugs, simply because the view became tightly coupled with application state and lost it's cohesive "generic view manipulation" idea.
If you think the best place for model-view conversion is in the view, then by all means, put it there. I don't know the details of your situation. I'm just pointing out some of the dangers. On Feb 16, 6:53 am, Supercobra Thatbytes <[email protected]> wrote: > > My first take away was that their were a few rules: > > 1) Presenters don't know about specific GWT widgets (so that you can > > test your business logic without GWTTestCase) > > 2) Displays don't know about business logic > > 3) Displays don't know about application logic > > 4) Displays don't know about model classes > > > I still consider the first 3 to be sacrosanct, but I have pretty much > > dropped rule #4. > > Dropping rule #4 maybe saving time and make the code read more clearly > but it will still tie your display class to a model - which may be OK > - if you accept the constraints. For example if you have a speedometer > display and want to display your car speed > > new SpeedoMeterView(Car car)... > > then you won't be able to display a motorbike speed: > > new SpeedoMeterView(Bike bike) ... > > unless you modify your SpeedoMeterView which is why you should NOT use > a model but use primitive types instead: > > new Speedometer(float mph) > > Daniel -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
