About responders in Cairngorm

Hello all
I am confused here. I have seen some examples of cairngorm in action - login screens, posts in a blog etc.
From what I have understood, I have got that all of my services will reside in the ServiceLocator mxml file. I have many service classes and I will create a RemoteObject for each of them, defining their methods inside the mx:RemoteObject tag using the mx:method tag.
But what about responders? Should I create a separate responder for every method of the every service? Or 1 responder per service? Or just once responder - its not a Singleton so I think this option is not correct.
Please guide me appropriately.
Thanks and Regards
ShiVik

Hello there
One responder object for every service? That doesn't seem to fit in.
In the command we create an instance of delegate and pass to it an instance of responder and after that a parituclar method of delegate is called.
This method in turn calls the method of service on server - so in nutshell, it means that my responder is going to respond to the method of service residing on server.
So doesn't that mean that I should create a responder for every method of my service? Or did I get something wrong here?
Please guide me
Thanks and Regards
ShiVik

Similar Messages

  • About delegates and responders in Cairngorm

    Hello all
    I am stuck in the implementation of Cairngorm micro-architecture in my website.
    I have to trigger an event which has to populate various combo-boxes on a page. Like countries, departments, locations etc. Now I have created a service which has various methods which return these lists like getCountries(), getDepartments(), getLocations etc.
    If I implement this is in Cairngorm,
    I will have an event may be like LoadPageEvent
    LoadPageEvent is mapped to LoadPageCommand
    Now I know that I will create a separate responder for every method like GetCountriesResponder, GetDepartmentsResponder, GetLocationsResponder.
    Bu what about delegates? Should I create a separate delegate for every method of service? or 1 delegate per service?
    Please guide me appropriately
    With best regards
    ShiVik

    Hello there
    One responder object for every service? That doesn't seem to fit in.
    In the command we create an instance of delegate and pass to it an instance of responder and after that a parituclar method of delegate is called.
    This method in turn calls the method of service on server - so in nutshell, it means that my responder is going to respond to the method of service residing on server.
    So doesn't that mean that I should create a responder for every method of my service? Or did I get something wrong here?
    Please guide me
    Thanks and Regards
    ShiVik

  • Communicate between responders and events in Cairngorm

    Hello all
    I am implementing presentation model pattern in Cairngorm. Now I generally separate the responder from command classes for the sake of dividing the responsibilities - command basically set the properties on model & execute sequence commands (if any), while responders handle the task of acting on the response received from server side.
    But I have a scenario where I have defined a callback function in my event class and need to call it in the responder. How can I do that? Does the responder have any idea which event triggered the whole process? If yes, how can it refer that particular event class and its methods/properties?
    Can somebody help me out here?
    With best regards
    ShiVik

    Thanks Paul.
    I have basically understood the cairngorm workflow and the presentation model. I have implemented Cairngorm quite easily in many of my views. But the problems were there to see as you mentioned in your blogs about presentation patterns. Since then, I have been seeking out best practices using presentation model. But it keeps on giving me a hard time.
    Sometimes it just doesn't seem worth it. Like I had created a loginState property in modelLocator to manage the view states in a login screen app. The states were ERROR, LOGGED_IN, LOGGED_OUT. The view was bound directly to modelLocator's property.
    But when I thought about implementing it in presentation model, I could think about following things:
    Creating a viewState property in presentation model for the view.
    Binding the view to the property in presentation model. Till here everything goes smoothly.
    When I update the loginState of modelLocator, I also need to update viewState of presentation model????
    To update the viewState of presentation model, I need to create a callback function in presentation model.
    I need to update the event as shown in this example and update the instance of that event, but what do I pass as reference to callback function?
    Too much going on for me to pickup.
    With best regards
    ShiVik

  • Data Management Services with Cairngorm 2.1

    Hello.
    I have been using cairngorm 2.0 for a while, and I am now
    trying to convert the 2.1 stuff over, including using cairngorm to
    manage my DataServices. However I have some questions about it if
    you have used it.
    Using the command, and passing the command into the delegate,
    and then firing the service from the delegate, there is a problem
    trying to catch faults. Even though I have a fault method defined
    on my command, and I am setting up the responder on the delegate as
    the command which called it, the fault handler is not being fired.
    I am generating a runtime exception on the java assembler just to
    see what happens, and the delegate never fires the fault handler.
    However if I remove the runtime excpetion from the java
    assembler, and put a simple alert on the result, the delegate sends
    to the commands result function, and the alert fires.
    If you have any code examples, even if they dont have the
    actual assembler behind them, I would really appreciate it. I dont
    know if you are supposed to define commands which call DataServices
    the same way you would declare a command that calls a RemoteObject.
    If so how do you do that? What do you declare on the command to get
    it to work?
    If you have any ideas, please help.

    Has this question already been answered on flexcoders? I
    think the Cairngorm folks may be more plugged in there than here:
    www.yahoogroups.com/group/flexcoders/
    Seth

  • Understanding the practical implications of the Cairngorm 3 Navigation Library

    Hi there again,
    Based on the discussion from yesterday:
    http://forums.adobe.com/thread/897088?tstart=0
    ... I forgot to mention that I have difficulties to find practical use cases for the Navigation Library. What does the Navigation Library solve when it will be used in the development architecture? Nothing explicit seems to be mentioned about it in your documentation:
    http://sourceforge.net/adobe/cairngorm/wiki/HowToUseCairngormNavigation/
    When speaking in theory I also have the concern that the Navigation Library is breaking the separation of concern between the Presentation Layer and the Domain Layer (when using the Domain Driven Design language):
    http://sourceforge.net/adobe/cairngorm/wiki/UnderstandingCairngorm/
    ... or the separation of concern between the View Layer and the Data Layer (when using my language):
    http://code.google.com/p/masuland/wiki/NanoarchitectureMVCb
    Practically speaking again, I usually store the application state (or the waypoints/landmarks of the application) in the Application Model ... see:
         public class AppModel
              // States
              [Publish(scope='appModel', objectId='loginBoxState')]
              public var loginBoxState:String;
              [Publish(scope='appModel', objectId='appStackState')]
              public var appStackState:String;
              [Publish(scope='appModel', objectId='settingsBoxState')]
              public var settingsBoxState:String;
    For more information please check out these two versions:
    http://code.google.com/p/masuland/wiki/LoginExample#Flex_4_(Halo)_with_MVCbCtl_PInj
    http://code.google.com/p/masuland/wiki/LoginExample#Flex_4_(Halo)_with_MVCbCtl_PInjDdd
    ... of my Login Example:
    http://code.google.com/p/masuland/wiki/LoginExample
    I hope you can help me clarify this!
    Thank you,
    masu

    I managed to reproduce this issue in the NavigationParsleyProject. After the NavigationParsleySample1 application is started the active view is content.dashboard.nested.child1. However if you try to navigate to content.tasks.timetracking view, it will redirect you to content.tasks.expenses view which is the first child in the content.tasks ViewStack. All Timetracking view's enter and exit handlers as well as interceptors will be executed though.
    After I commented out the metadata for all event handlers and both interceptors in TimeTrackingPM class, I was successfully navigated to the content.tasks.timetracking view.
    This issue occurs only once and I believe it has something to do with the deferred instantiation. I tried to debug the source of the navigation library but haven't had any success yet.

  • Best use of a model in cairngorm

    I am a little confused about the use of a model , ModelLocator, in cairngorm
    I have it created and it all works fine but whats the best way to access it, Currently i have numerous forms that all do something like
        <fx:Script>
            <![CDATA[
                import com.model.ModelLocator;
                [Bindable] private var model:ModelLocator = ModelLocator.getInstance();
    and then later on
                private function fun1(evt:Event):void
                   model.something = "blah"
                   var s1:String = model.anotherSomething;
    or whatever
    Is it ok to have varibles all over the place in different mxml files all creating a private var model, does this comsume resouces or is it ok because its static
    Also i have several arrayCollections 11+ , plus other stuff in the model, is this ok

    Hi JockMahon,
    Its ok fine you can go with that..
    However remember one thing you will be declaring any variables in the ModelLocator class only if you are using them through out your application .. I mean more than one mxml page or AS files. However if you require any property or variable only within a single file then you can declare it locally within the file instead of decalring it in
    ModelLocator.
    The ModelLocator class in cairngorm framework is a singleton class so in how many files you have a model variable it will actually refer or return only single static instance of the ModelLocator class.
    [Bindable] private var model:ModelLocator = ModelLocator.getInstance();
    So how many times you have a variable by using the above style of decalring you will only get a single static reference to the instance of ModelLocator class. No ne instances are created. Its like you get a pointer to the model variable.
    Hope it is clear now.
    Thanks,
    Bhasker

  • How to use cairngorm framework in flex 4?

    Hi Everyone!
    Right now i am working with Flex 3.5 sdk using cairgorm architecture. Now i want to move to Flex 4 sdk with cairgorm architecture. I tried to use the cairngorm architecture in flex 4 sdk. But i did not get the output.
         Please anyone let me know how to use the cairngorm artchitecture in flex 4 sdk.
    Thanks in advance.!

    Read about Presentation Model. Refactor towards that and you should fine.
    C

  • Deep linking integrating with Cairngorm 3 Navigation Library

    Hi there,
    I wonder if the Cairngorm 3 Navigation Library will integrate deep linking in future? Furthermore, it would be great to know how deep linking could be used in coexistence with the Cairngorm 3 Navigation Library!
    Any thoughts about it?
    Thanks,
    masu

    Hello François,
    As adviced, I have posted this feature request to your jira:
    http://bugs.adobe.com/jira/browse/CGM-94
    For the moment, only John Cunliffe from this post:
    http://forums.adobe.com/thread/872180
    ... is capable of providing a working patch.
    Please keep me posted!
    Thank you,
    masu

  • Cairngorm 3 and Commands - best practice

    Hi chaps
    Excellent work on CG3, it solves a lot of issues and I really like how it integrates with Parsley; definitely a step forward.
    About the integration lib and commands - in Cairngorm 2, it would be quite common to fire off a persistence event directly from a model, like this:
    public class User
        public var name : String;
        public function save() : void
            new UserEvent( UserEvent.SAVE_USER, this ).dispatch();
    However, using CG3, something like:
    -- SaveUserCommand.as
    public class SaveUserCommand
        [Inject]
        public var delegate : IDelegate;
        [Command]
        public function execute( event : SaveUserEvent ) : AsyncToken
            return delegate.saveUser( event.user );
    -- User.as
    [Event( name="saveUser", type="somepackage.event.UserEvent" )]
    [ManagedEvents( "saveUser" )]
    public class User
        public var name : String;
        public function save() : void
            dispatchEvent( new UserEvent( UserEvent.SAVE_USER, this ) );
    unless we do something funky here, Parsley won't know about domain classes as they are not part of the context, therefore won't pick up the [ManagedEvents] metadata. I'm fairly new to Parsley though, so there may well be a simple way of doing this.
    Is there a way of hooking domain classes directly to commands or, with this new architecture, should this be the responsibility of the presentation model instead - i.e. myPM.saveUser( myUser )?
    Thanks
    Richard

    Hi Alex
    Thanks for the reply.
    "But you definitely need to specify the domain in your Parsley context."
    Not sure I follow here - probably a question more for the Parsley forum than here, but could you give me a brief example of what you mean? In this instance do you mean somehow register each individual User with the context or maybe a UserProvider?
    Thanks
    Richard

  • What is cairngorm and is it currently used in companies?

    HI,
    I am new to flex technology and wants to know about the cairngorm framework.
    Is this something that is still used in companies and is worth learning?
    What is the current version of cairngorm?
    Please provide some important article links that uses cairngorm for building Flex applications.
    Thank you in advance.

    Dear Bashir,
    1.MRP is material requirements planning which plans the required quantity of depedent material's along with the required date.
    2.MRP procedure is sub divided into a normal MRP,Master Production Scheduling and Consumption Based Planning.
    3.Cosnumtion BAsed planning is further sub-divided into Time Phased Planning,Reorder Point Planning and Forecast based
    Planning.Reorder point planning can be automatic or Manual.
    4.MRP type is differentiated using the MRP type value assigned in the MRP1 view of the material master.
    5.Some of the MRP types are PD - MRP,M0,M1,M2,M3 - MAster Production Scheduling related,VB - Manual reorder point
    planning,VM-Automatic reorder point planning.
    6.It is possible to take the MRP for the whole plant/for a specific MRP area using the batch MRP job.
    7.MDBT is the T Code for scheduling the MRP job or it can be scheduled for the program RMMRP000 using the T Code SM36
    and the results can be checked using SM37.
    Regards
    Mangalraj.S

  • Cairngorm & Problems with Shared Components

    Thanks in advance for any help. I still consider myself a
    newbie, so please excuse any stupid errors that I make in
    describing the problem I am having.
    I am working on a Cairngorm app, the framework of which has
    been handed to me. I have a component that can be used to either
    enter or "update". Update is in quotes because what really happens
    is that the old record is voided and a new one is entered -- but
    the user is oblivious to this.
    This component, which wraps and submits the data, is
    instantiated twice in the app. Each instantiation is accessed via a
    different "link". The problem: each time the user enters or
    "updates", 2 records entered. I watch it in debug, two RPC's and
    two results. I assume that this is because the component is
    instantiated twice and, for the life of me, I cannot figure out how
    to prevent this. I
    I have tried a couple of things 1) created two sets of events
    (Cairngorm & Completion), one for submit and one for modify,
    but because the command expects a Cairngorm event of a certain
    type, it can't handle both without a bunch messing around. I tried
    using one initial Cairngorm event (submit) and two distinct
    completion events, but no go. I am thinking about now creating two
    commands .... ???
    Actually, this is not a new problem. I am a bit under the gun
    here, so when it came up before, I duplicated all the code,
    including everything related to RPCs (DTOs, commands, etc.) but
    this is becoming a nightmare to maintain and is bad, bad, bad ....
    Any suggestions? This cannot be a completely uncommon thing?

    I am not sure why you need to instantiated the component
    twice. A component can broadcast several different events of the
    same Type. For an example:
    broadcaster.broadcastEvent(WidgetEvent.ENTER, new
    WidgetEvent(widgetVo));
    broadcaster.broadcastEvent(WidgetEvent.UPDATE, new
    WidgetEvent(widgetVo));
    Are you sure the component doesn't broadcastEvent 2 calls for
    a each click? Perhaps one is being fired off in a subclass and the
    other in the super class?
    "...but because the command expects a Cairngorm event of a
    certain type..."
    The command expects a Event Type. Cairngorm will deserialize
    your custom event into a Event type with the following properties:
    public var type:String;
    public var data:Object;
    So the data will property will hold your custom Event. And
    you would set that as an instance var in the command.

  • Cairngorm View Helper - Command resuability and tight coupling with view

    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..

    Hi, the view Locator has very issues that we have to have in mind, y most of the  problems are similar when we are using the Drag Manager , when we are using modules and load this view dynamically.
    The solution is simple and you told it. Binding by Watchers in the model Locator and checking the model locator variables when we load a module.
    In the view that we want to change we can add a Change Watcher linking a model locator variable to a function in the view, we change the model in de command and automatically change the value in the view.
    There are 2 ways to do the same concept, but is good only when the call to a cairngorm only affects the view that its calling it and known more has to know, so in theory you don’t need to change the model to impact the view.
    First is adding a Iresponder in to the event by Get Set so in the view, when you create a event for cairngorm and have to pass through the event an IResponder  (mx.rpc.IResponder). When you are in the command in the result or fault you can do event.responder.result = event or event.responder.fault = event and this well go directly into the view result o fault. So you don’t have to pass through the model. (Responder is your get set in the Event of private var _responder:IResponder)
    The other way is the same but using UM cairngorm that has CallBacks. And it’s pretty much the same but the event and all the cairngorm has callbacks and notifyCaller.
    Well I hope I said something useful.
    I did a UM cairngorm diagram in English http://www.developyourdream.net/tutoriales/tutoriales_flex_avanzados/cairngorm_universal_m ind/Cairngorm.swf
    Sorry me English and if somebody talks Spanish you can go check my blog http://www.developyourdream.net/ 

  • Cairngorm development Q

    I have a call to the db which gets a list of order pads.
    When this list is returned i then need to create N number of visual order pads
    How should this be done. using a data binding and a repeater is not an option. i really just wan to call a function in the view to loop over the result set creating the views

    Are you talking about Cairngorm 3 or 2?
    In Cairngorm 3, which is about Presentation Model Pattern, calling the function directly would be inconsistent to the Architecture.
    This doesn't mean that you are not allowed to use any action script in the views, but the code in views should only deal with graphical presentation.
    So anyway you should first update the model wih the data returned from the db and the view who is observing model should then update itself.
    So if mx:Repeater or custom ItemRenderer is not an option (why actually ? ), there are 2 another solutions:
           1. Dispatch an Event on model update and make the view listen to this event.
           2. Use databinding to a views setter method.
    The second approach will result in less coding , but interenally it's implemented by eventdispatching machanism anyway. At least you will probably want to call any function on the model change and not just the setter. Therefore you can implement a generic Observer class.
    On the Paul Williams blog entry about the Presentation Model you can find a sample App with 'View Source' option.
    http://blogs.adobe.com/paulw/archives/2007/10/presentation_pa_3.html
    In this app the author is using the binding to a function approach. It's not exactly your UseCase. The app is displaying alert messages on model changes. To call a function on model change Williams is using an Observer Class, which is placed as Tag in MXML Views. Examine the code in AlbumBrowserView
    You can also find an observer class in the Cairngorm 3 library.

  • Questions about interfaces,monitors,keyboards,cables help please

    I just bought a macbook pro 1.87ghz. w/ 1 gb I would like to record music primararly acoustic stuff (john mayer type stuff) I was wondering what types of
    interfaces or keyboards, mics, monitors, cables ,should I buy to get the most professional sound with. I have a budget of about 1200.00 I want to spend any recommendations? Please Help I appreciate your time:)

    What I would probably go with in this situation, using the limited information you have given:
    Interface - Presonus Firebox $300
    Keyboard - M-Audio Oxygen 8 v2 $150
    Mics - Studio Projects B1 and C1 $300
    Monitors - Event ALP5 $300
    (really would depend on whatever small monitor sounds best to you)
    Cables (firewire, usb, mic, stands, etc.) - $100
    Now you will probably get as many different answers as you will responders but the best advice I can give is to read everything you can on recording and mixing. During this time, save up another $800 or so and treat your recording and mixing area.

  • CairnGorm Design Patterns

    Can any one let me know the design patterns
    implemented in Cairngorm?

    Are you talking about Cairngorm 2 or 3 ?
    Cairngorm 2:
    Model View Controller
    Command
    Responder
    Delegate
    Singleton
    Cairngorm 3 (on top of Parsley):
    Dependency Injection
    Presentation Model

Maybe you are looking for

  • Cd/dvd player no longer functioning the same.

    My player used to work just fine. I went to burn some cd's of photos and found it no longer was functioning. I read numerous posts and have tried all the fixes that I found. First here are the issues. 1. plays music cd's (purchased) 2. As of today sp

  • Problem with array type in SOAP response for sync interface

    Hi, We have a Synchronous Interface from SAP -->PI-->Unifier .The WSDL response has array type and when WSDL is imported it is showing red (I was able to activate  and use it in mapping) .We are able to send the request successfully and when retrievi

  • I think my iphone got a virus,  help

    i was on the istaller and downloaded a sumerboard theme, it gave me an error, wich said i could not download, now my phone screen flickers, takes forever to go to the main screen, i can use any of the functions, it keeps trying to load something, has

  • Abaper's role in the project ?

    what is abaper's role in the projects. what are the difficulties abaper's faced in the project ? i had no real time experience ? can u explain with one example plzzzzzz ?

  • Quran application on Nokia E90

    Hi everyone, I just installed the new Quran software from the nokia ramadan software on my Nokia E90. It is a very nice application. However, the browser had a problem of not viewing some text fields in most of the websites. Has anyone faced this pro