3 Replies Latest reply on Jun 2, 2009 7:19 AM by Rene Szabo

    Cairngorm View Helper - Command resuability and tight coupling with view

    msajith
      I am new to Cairngorm framework. Currently we are converting our project to Cairngorm framework. I have some very basic doubts regarding the framework. Basically I am a java/J2ee
      programmer and got very good experience in struts framework and other J2EE design patterns.
      I have some doubts and needs advice from the community .

      My very first doubt is regarding the ViewLocator pattern used in the Cairngorm framework to access
      the view from Command class. At a very high level my understanding about command pattern is that command object shouldn't know anything about the caller. Command should execute a the business logic and update the model.
      But if we use the ViewLocator pattern the command object should know about it's caller class and the method name of the view/viewhelper class which should be executed after the command logic. In this scenario we will not be able to reuse the command class and a very tight coupling is established between the command and view.
      I have read from flex and cairngorm related blogs about an 'Observer' and 'ChangerWatcher' patterns which seems to be right approach for me rather than using the ViewLocator. But as far as I know these are not part of the framework.
      I would like to know what is the recommended approach from the cairngorm framework team for executing View related logic after firing the Cairngorm event.
      If we use the ViewLocator pattern, there is no reusability as far as the command is concerned and also a very tight coupling is happening with the command and view.
      Is this the right approach..?
      Please advice..