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/ 

Similar Messages

  • WLS8.1 and tightly coupled transactions?

    I have the following scenarion that does not seem to work.
              1. A client calls a method in EJB1
              2. EJB1 inserts a row in a database
              3. EJB1 calls a method in EJB2
              4. EJB2 tries to read or reference the row inserted by EJB1.
              5. The database waits and eventualy an Exception is thrown.
              It seems as WLS treats the XA-transaction as loosley-coupled (see the XA-specification). The behaviour that I want is a tightly-coupled transaction, but that does not seem to be the case.
              - I'm using WLS8.1sp4
              - EJB1 and EJB2 are stateless session beans using CMT and default behaviour.
              - EJB1 and EJB2 uses different database pools.
              - I'm using Informix 7.31 Database and Informix JDBC XA Driver 2.21JC6
              Anybody that have any ideas about this?

    Hakan Waller wrote:
              > I have the following scenarion that does not seem to work.
              >
              > 1. A client calls a method in EJB1
              > 2. EJB1 inserts a row in a database
              > 3. EJB1 calls a method in EJB2
              > 4. EJB2 tries to read or reference the row inserted by EJB1.
              > 5. The database waits and eventualy an Exception is thrown.
              >
              > It seems as WLS treats the XA-transaction as loosley-coupled (see the XA-specification). The behaviour that I want is a tightly-coupled transaction, but that does not seem to be the case.
              >
              > - I'm using WLS8.1sp4
              > - EJB1 and EJB2 are stateless session beans using CMT and default behaviour.
              > - EJB1 and EJB2 uses different database pools.
              > - I'm using Informix 7.31 Database and Informix JDBC XA Driver 2.21JC6
              >
              > Anybody that have any ideas about this?
              I think the issue is that the data inserted in EJB1 is not available
              for anyone else to see until that EJB's transaction is committed.
              If EJB2 is defined so that it joins the same transaction, it should
              be able to see the not-yet committed data, but if it's a different
              tx, it shouldn't. However, how is EJB2 able to access the data via
              a different pool than the one used to insert the (not-yet committed)
              data?
              Joe

  • Viewing firewire external device and VGA monitor with mirroring off

    My mac laptop is connected to an external monitor via the VGA port and I keep mirroring off to maximize display space. When using FCP I want to run firewire out to a professional DVcam deck for both capture, and to view the timeline on an external monitor that I see by using 'RCA monitor out' on the DVcam deck to the monitor. However, as soon as I turn mirroring off, the deck no longer sees the firewire. How can I see the firewire out and the VGA display monitor when mirroring is off. thanks

    Is the ADVC powered? When you connect firewire to the back of the unit, it gets powered by that connector, but the firewire jack on the front is only 4-pin and doesn't support power.
    If you have a 6-pin to 6-pin firewire cable, try connecting it to the back of the ADVC110 and then the front of the box should light up, indicating power.
    I'm having a similar issue. I can print to tape via the Canopus box, but I want to be able to drive a monitor with it just so I can have an NTSC monitor while I'm editing. I can't seem to make it work. Any ideas?

  • Need help solving listener and Oracle problems with Mac OS X 10.4 "Tiger"

    I have Oracle 10g working on Mac OS X 10.4 "Tiger" except for the listener and Oracle net 8 configuration. I have not been able to get the Oracle listener to work with my built in Mac Airport wireless network card or built in ethernet card. I keep getting the errors
    connection refused cannot start listener. Can anyone offer help?
    Thanks
    Ben
    [email protected]

    Hi Ben,
    how does your listener.ora look like ?
    Mine is:
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = ronald-g4-eth)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = ronald-g4-wifi)(PORT = 1521))
    and listens to the ethernet and airport address.
    When do you get the problems ?
    regards,
    Ronald
    http://ronr.nl/unix-dba

  • HELP! retrieving and displaying data with JavaBean but Page is Blank!!

    Please help. I am trying to display data for user by appending the userid as parameter in the URL but I get a blank page and nothing displays in my jsp page.
    //info.java
    package database;
    public class Info{
    private String user;
    public Info(){
    public void setuser(String user)
        this.user = user;
      public String getuser()
        return user;
       public Collection getInfo() throws NamingException, SQLException {
                    ArrayList list = new ArrayList();
                    InitialContext initCtx = new InitialContext();
                    //OTHER CONNECTION STATEMENTS
    String sql = "SELECT ADDR FROM TABLENAME WHERE user=' ?'";
                    try {
                            conn = ds.getConnection();
    pstmt = conn.prepareStatement(sql);
    pstmt.setString(1, this.user);
    rs = pstmt.executeQuery();
    while(rs.next()) {
            InfoBean tsel = new InfoBean(rs.getString("addr"), this.user);
    list.add(tsel);
          //catch SQLexception
    } finally {
    try{
               if (initCtx != null)  initCtx.close();
            if (rs != null)  rs.close();
            if (pstmt != null) pstmt.close();
            if (conn != null) conn.close();
    //catch SQLException statment
          return list;
    //InfoBean.java
    package database;
    public class infoBean
    private String user;
    private String addr;
    public infoBean(){
    public infoBean(String addr, String user)
    this.user = user;
    this.addr = addr;
    public String getaddr()
    return addr;
    public String getuser(){
    return user;
    public void setaddr(String addr){
    this.addr = addr;
    public void setuser(String user){
    this.user = user;
    //index.jsp
    <jsp:useBean id="row" class="database.Info" scope="request">
    <jsp:setProperty name="row" property="user" param="user"/>
    </jsp:useBean>
    <c:if test=${!empty param.user}">
    <c:forEach items="${row.info}" var="t1">
    <td>${t1.addr}</td<>
    </c:forEach>
    </c:if>

    OK, before we all go rummaging through your code--does your SQL statement return values when you execute it as a stand alone adhoc query?

  • Event Viewer: How to search and find event with specific text in the EventData

    Hello,
    When I use "Find..." option in the windows event log, it does not search within event's detail or text in <EventData> xml node on the event.
    Is there any easy, out of the box way to find all events that include an specific phrase in the <EventData> ?
    Thank you,

    Hi Allan,
    I‘m writing to check if the suggestions were helpful, if you have
    any questions, please feel free to let me know.
    If you have any feedback on our support,
    please click here.
    Best Regards,
    Anna
    TechNet Community Support

  • Can new PWA views be created whereby a filter can be set and associate to the view by default? (Project Server 2013 ONLINE)

    My main question is: Can new PWA views be created whereby a filter for that view can be set, and associate to the view by default? (Project Server 2013 ONLINE)? and can I have a filter set to filter on person logged on to...
    In previous versions of Project Server, when CREATING a PWA view, we were able to apply/ define a filter for that view.  Does not seem like it is the case in Project Server 2013 Online.  And if I remember, we could also use the URL Guid_view_id. 
    Please confirm; and / or tell me how-to.
    What I was hoping to do is the following... Given that our standard that we have adopted for reporting time is 'My Timesheets' (fyi, Single Mode Entry=ON), we have some resources who have others who do it on their behalf via 'My Tasks' (ie., accomplished
    by using the 'Assignment Owner' field, accordingly).  Therefore, when entering time on someone else's behalf within 'My Tasks', we like to present the user that is logged in only the tasks that they are are assigned to update on others' behlaf.
    I know that there is another more elegant approach to doing this which may be to use the Delegation feature. But since we are trying to stick to Sharepoint Security mode for now, this is not an option for the time being.
    Any help appreciated would be greatly appreciated.
    \Spiro Theopoulos PMP, MCITP. Montreal, QC (Canada)

    Hi Spiro,
    1- You still can define in Project Online a filter in the view settings, it is located just above the category setting. Here is a screenshot of the summary project center view:
    2- The view GUID is not anymore in the URL, since the URL triggers an action only on the webpart and not on the whole page. I agree this is annoying since it was great to send a URL with a specific view.
    3- Concerning the access to my timesheet versus my task, I'm not sure to get a full understanding but on a general way, it is much more easy to deal with those situation using categories which you cannot do with the SP permission mode.
    Hope this helps,
    Guillaume Rouyre, MBA, MVP, P-Seller |

  • Issue with Smart View Help Contents using v11.1.2.0.01

    Hi there,
    I just installed v11.1.2.0.01 (Build 003) of the Smart View add-in on a MS Windows XP SP2 PC with MS Office 2003 SP3.
    Unfortunately, the Help Contents in MS Excel does not seem to work as whenever I select Smart View > Help > Contents, nothing gets displayed. Selecting Smart View > Help > Technical Support and Smart View > Help > EPM Documentation takes me to various links on the www.oracle.com site.
    I uninstalled then re-installed this specific version a few times but to no avail. I even checked the contents of each subdirectory where Smart View has been installed but could not find any Help files whatsoever.
    1. Has anyone ever encountered this issue?
    2. If yes, what do I need to do to resolve this issue and get the Smart View Help to be displayed?
    Thanks in advance,
    JBM

    Well, reading the documentation about knowing where to find the documentation would have actually helped. At the bottom of page 10 of the Smart View ReadMe document, the following is mentioned under the "Documentation Updates" section:
    "For Smart View online help to be available, the Shared Connections URL on the Advanced page of the Options dialog box must contain an EPM Workspace URL."
    This question is now answered.
    JBM

  • Something weird happening with View Options....

    Hi!,
    OK, so I go into my hard drive root (where the library, users, system folders are). I go to the View menu and choose Show View Options. In that small panel, I check the Show Item info checkbox so that it shows me all the info about folders. I enable it and close the window. Now under all the folders, it says how many files are indside them. All the numbers were correct and I was happy until I noticed that the printing underneath the Applications folder said that there were no items inside. So, I went into the applications folder and all my apps are still there (phew!) . I logged out and logged in to see if that fixed it but NOPE, it still had "Not items" under the Applications folder. Whats goin' on?
    I know that this may be a small problem with nothing to worry about but I'm afraid that all the other options may be going crazy as well. Is there a pref file I can trash?
    Any help is appreciated
    Indragie

    Hi Indragie,
    You must not have noticed the option at the top of the View Options box. The radio button for "All windows" must have been on. So you ended up making a global change. Perform a View Options command again and reverse it by turning off the "Show Item" info with the same "All windows" option on. That will clear that setting from all other folders. In the future, watch that option carefully and make sure to set it first.

  • Help setting up Applescript to process with a batch of files.

    Hello everyone!
    A couple of days ago I posted here about needing an Applescript to be able to parse large text files into smaller ones. A lovely contributor, twtwtw, helped me out and came up with this script:
    set f to choose file with prompt "Choose the file to parse."
    tell application "Finder"
        set fName to name of f
        -- the following line assumes that the file name has a three character extension, like '.txt'
        set foldName to text 1 thru -5 of fName
        set fold to (make new folder at (path to documents folder from user domain) with properties {name:foldName}) as text
    end tell
    set fp to open for access f
    set bigText to read fp
    close access fp
    set parsingText to "All Rights Reserved"
    set parsedList to tid(bigText, parsingText)
    -- the following line requires that the file name be exactly in the form "<prefix>_<suffix>" with only one underscore
    set {prefix, suffix} to tid(fName, "_")
    repeat with i from 1 to count of parsedList
        set newFName to prefix & "_a" & i & "_" & suffix
        set fp to open for access (fold & newFName) with write permission
        -- uncomment the following line if you need to overwrite old files, otherwise it will append
        -- set EOF of fp to 0
        write ((item i of parsedList & parsingText) as text) to fp
        close access fp
    end repeat
    on tid(input, delim)
        -- a subroutine to handle text item delimiters. Useful tool, but so danged wordy.--
        set {oldTID, my text item delimiters} to {my text item delimiters, delim}
        if class of input is list then
            set output to input as text
        else
            set output to text items of input
        end if
        set my text item delimiters to oldTID
        return output
    end tid
    It turns out however, that I have about 500 of these large files that need parsing, so I was wondering if there might be a way to modify the script by allowing more than one input file, so that it would repeat the parsing action for all input files passed to it.
    Can anyone help?

    try this:
    set f to choose folder with prompt "Choose the root folder containing your files."
    traverseFolder(f)
    on traverseFolder(fold)
         tell application "System Events"
             set containedItems to every disk item of fold whose visible is true
             repeat with thisItem in containedItems
                   if class of thisItem is folder then
                       my traverseFolder(thisItem)
                   else if type identifier of thisItem contains "plain-text" then
                       my processFile(thisItem, fold)
                   end if
             end repeat
         end tell
    end traverseFolder
    on processFile(thisFile, itsFolder)
         tell application "System Events"
             set fName to name of thisFile
      -- the following line assumes that the file name has a three character extension, like '.txt'
             set foldName to text 1 thru -5 of fName
             set newFold to path of (make new folder at end of itsFolder with properties {name:foldName})
         end tell
         set fp to open for access thisFile
         set bigText to read fp
      close access fp
         set parsingText to "All Rights Reserved"
         set parsedList to tid(bigText, parsingText)
      -- the following line requires that the file name be exactly in the form "<prefix>_<suffix>" with only one underscore
         set {prefix, suffix} to tid(fName, "_")
         repeat with i from 1 to count of parsedList
             set newFName to prefix & "_a" & i & "_" & suffix
             set fp to open for access (newFold & newFName) with write permission
      -- uncomment the following line if you need to overwrite old files, otherwise it will append
      -- set EOF of fp to 0
      write ((item i of parsedList & parsingText) as text) to fp
      close access fp
         end repeat
    end processFile
    on tid(input, delim)
      -- a subroutine to handle text item delimiters. Useful tool, but so danged wordy.--
         set {oldTID, my text item delimiters} to {my text item delimiters, delim}
         if class of input is list then
             set output to input as text
         else
             set output to text items of input
         end if
         set my text item delimiters to oldTID
         return output
    end tid
    I changed to system events for efficiency reasons (the Finder can get bogged down with too much scripting).  the only place you might run into issues is line 11, where it says else if type identifier of thisItem….  that might miss files if they have odd type identifiers (though it should get most plain-text files).  I only put that if statement in there to keep from processing spurious files that might be in the folders - you can replace that whole line with a simple else if you find it's gumming up the works.

  • How do I remove the previous owner's Apple ID from my 2nd hand iPhone, and replace it with my Apple ID?

    How do I remove the previous owner's Apple ID from my 2nd hand iPhone, and replace it with my Apple ID?

    settings - appstore - view id - log out and log in with your id.

  • HT4527 I am trying to transfer music files from one PC to another using homeshare and although I can view the music as a shared folder I cannot initiate the "import" process.  I have iTunes 11.0.1.12 on both computers so the help screenshots do not help a

    I am trying to transfer music files from one PC to another using homeshare and although I can view the music as a shared folder I cannot initiate the "import" process.  I have iTunes 11.0.1.12 on both computers so the help screenshots do not help as such

    Then stop trying to use HomeShare and use one of the other options listed in the document from which your question was posted.

  • A box with a blue outline appeared in my bookmark drop-down menu. I can't get rid of it, and it obstructs the view of the bookmarks as I scroll up or down. Help!

    I was trying to bookmark a page, using the "Choose" menu in the bookmarks. I must have touched a key by accident, and a box with a blue outline & the name of one of my folders appeared in my bookmark drop-down menu. At first the box contained the folder name, then I was trying to delete the box, and erase the name, thinking it might get rid of the box, but it didn't. I can't get rid of this box! It obstructs the view of what is underneath. It stays in the same position as I scroll up & down in the drop-down menu, and it hides what is underneath. Please help me get rid of this box. It is driving me crazy! Thanks!

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    See also:
    *http://kb.mozillazine.org/Corrupt_localstore.rdf

  • When I open itunes to play content I've already purchased and while attempting to view trailers for movies in the itunes store, I receive a generic error message from windows, and I'm directed to reinstall the latest version of itunes.  Not a fix.  Help?

    When I open itunes to play content I've already purchased and while attempting to view trailers for movies in the itunes store, I receive a generic error message from windows, and I'm directed to reinstall the latest version of itunes.  Not a fix.  Help?

    after perusing other subjects with playback issues: 
    this is the fix: 
    -Launch Control Panel - Double click Quicktime, If you do not see quicktime, look on the top left side of control panel and switch to classic view. This will then allow you to see Quicktime.
    -Now click the advanced tab and click on Safe Mode GDI Only, Apply, then ok.

  • HELP FOR RUN PHOTOSHOP IN COMMAND PROMPT AND OPEN FILE

    HELLO
    i have problem for run photoshop in cmd(command prompt) and
    open a file immediate
    for example:
    D:\Program Files\Adobe\Photoshop CS>Photoshop.exe -open -f:\1.jpg
    but these not answer
    I need parameter open in photoshop
    please help me
    thanks

    I would right click on 1.jpg. Select Open with... Select Choose default program... Pick Photoshop and make sure you check "always use the selected program to open this kind of file."
    D:\1.jpg
    Would then open photoshop.

Maybe you are looking for