In MVC, how should already-loaded data be handled?

I have an AS3 application and I'm trying to implement an MVC framework.
On the model's initialization, data is gathered about the user. When the user clicks a button, say to print their first name, I want to request and retrieve only that data from the model.
I currently have the view listening for a button click. The button click is handled by the controller. The controller fires a "getUserFirstName" method in the model. I'm confused about this part...
Since the controller and not the view is calling the method, I can't do a return of the user's first name in this method. Should I dispatch an update event? I'm not sure how to pass this data to the view in the most efficient way. Thank you.

Good question Kevin.  Design patterns are my forte, so I can assist. first the view is allowed to receive input events but rarely should.  The view as it's referring to is the reflection of data and nothing more.  The controller is the gate way of the users input to the model,  The controller either passes data to the model or can control a views placement/initialization.   Both view and controller have access to the model. The model should retain a reference of any of it's subscribers.  When data is changed in the model, the model should send a notification to any and all subscribers.  I in your case this is the view and controller.  Upon this notification, the view and controller will access the model and retrieve what they require.  There are two types of models.  A push and a pull.. What I just described is the pull methd.  A push is where the model will send in e dispatch what has changed.  For more information feel free to order my latest design pattern book for design patterns on amazon.  advanced action script design patterns.

Similar Messages

  • How can I load data into table with SQL*LOADER

    how can I load data into table with SQL*LOADER
    when column data length more than 255 bytes?
    when column exceed 255 ,data can not be insert into table by SQL*LOADER
    CREATE TABLE A (
    A VARCHAR2 ( 10 ) ,
    B VARCHAR2 ( 10 ) ,
    C VARCHAR2 ( 10 ) ,
    E VARCHAR2 ( 2000 ) );
    control file:
    load data
    append into table A
    fields terminated by X'09'
    (A , B , C , E )
    SQL*LOADER command:
    sqlldr test/test control=A_ctl.txt data=A.xls log=b.log
    datafile:
    column E is more than 255bytes
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)

    Check this out.
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96652/ch06.htm#1006961

  • How do i load data in excel to an oracle table

    How do i load data from an excel file with several worksheets into an oracle table?
    using Oracle 10g
    Excel
    sample data of excel
    Name eric Name mary
    AccountNo 123 AccountNo 321
    amount1 5.0 Amount1 1.0
    amount2 5.5 Amount2 2.0
    amount3 6.0 Amount3 3.0
    Total 16.5 Total 6.0
    Name larry Name beth
    AccountNo 123 AccountNo 321
    amount1 5.0 Amount1 1.0
    amount2 5.5 Amount2 2.0
    amount3 6.0 Amount3 3.0
    Total 16.5 Total 6.0
    Note: Assume data are aligned into columns like a real excel workbook

    Hi,
    You can make one csv file per sheet. After what you can use sql*loader utyility.
    Since 9i, there is external table : http://download-west.oracle.com/docs/cd/B14117_01/server.101/b10759/statements_7002.htm#i2129649
    Nicolas.

  • How should I partition data across 2 hard drives to make for less latencey?

    Hello all!
    I am using a Dual 2.7 G5 Power Mac and I just bought the Hitachi 500GB internal hard drive to supplement the stock 250GB drive that came in the tower. I mostly want to orient my computer for the needs of a home recording studio. I am Logic Pro user and I want to streamline data retrieval as efficiently as possible.
    Now, I also have a good deal of other junk on my computer (video and iMovie projects). I would love an organization solution on how to partition everything that I have filled my 250GB drive up with across both hard drives. I'm aiming for a solution that will be good for the long-term as I continue to add more and more stuff (audio/music related and non) onto my hard drives.
    Here are a few of the primary concerns which have held me back from just diving in:
    I have several DVD's worth of audio samples (for use with software sampler) that I have yet to load onto this computer. Should I load/move all of my samples onto the secondary 500GB drive or would the streaming retrieval of all of that content from the secondary drive add extra latency and slowdown when the host application running these tasks and retrievals is ran off of the primary drive (the 250GB drive on which the OS is installed)?
    Or should I just move Logic to the secondary 500 GB drive as well as all of the audio samples and run all things having to do with audio production off of that secondary 500GB drive? Would running such a CPU intensive app from the secondary drive make a performance difference compared to running it off of the primary drive? Does it matter whether or not a program is run off of the hard drive where the OS is installed?
    Or should I find a way to have all apps running from the primary 250 GB drive WITH all samples (streaming and non-streaming) also on that drive and just have my project files and audio recording sessions (which eat up large portions of space) located on the secondary 500 GB drive? Or would I run into a noticeable latency with having the recorded audio sessions ran off of the secondary hard drive when I am running the application that retrieves them (Logic) off of the primary drive?
    Where do I put my pro apps? Where do I put my audio samples (mainly for EXS24, SampleTank, and BFD)? Recording sessions? Everything else?
    Please, experienced users, what should I do to garner the best performance out of my Mac?
    Thanking everyone in advance,
    Matt!
    P.S. I am running OS 10.4.6 and using 4.5 GB of memory.

    Thanks you guys. X, that is interesting to read. Chap, I see what you are saying. But I just found these two FAQ's from BFD's website. How do you feel in reference to them? Is it me, or do these questions somewhat contradict each other? :
    Is it a good idea to put BFD on its own partition on my audio drive? [top]
    In general, no. If your harddrive is partitioned and you are streaming from both the BFD partition and your own tracks, this will lead to the hard drive read head jumping back and forth between the two partitions, which may reduce performance. Also, if you are streaming non-BFD audio from the same drive, this reduces the bandwidth available for BFD streaming.
    On which hard drive should I install my BFD data? [top]
    FXpansion recommends, in order of performance preference (first is best):
    1) A dedicated SATA or IDE internal drive, 7200rpm or above
    2) A dedicated external firewire drive (do NOT chain the firewire drive with a digi002 or other firewire audio interfaces!)
    3) A dedicated external USB2.0 drive
    4) An internal drive shared with the data from other heavy disk-accessing programs, eg the operating system (virtual memory swap files), or another disk streaming application such as your host sequencer (audio tracks) or Kontact etc etc.
    Power Mac G5 Dual 2.7Ghz 2.5gigs of RAM   Mac OS X (10.4)  
    So it sounds like they recommend BFD having its very own hard drive. I dont have the resources for that right now. So I wonder what would be better: Sharing the OS drive with BFD as mentioned by X and used as the last resort from FAQ #2, or split my second drive via partition into Samples (including BFD audio) and Storage for projects and raw, recorded audio sessions.
    If only I wasn't such a perfectionist. I would get so much more work done! Thanks again guys. I am indebted.

  • Adding new date field to already loaded data target.

    Hi,
        we have a cube containing date feild such as 0CALMONTH. the data is being loaded to the cube. now they have added new date feild (0FISCYEAR). how to get data to this feild. there is no data coming from source system for this feild. please can any one tell me how to include this feild and load data into it.
    with regards,
    sreekanth.

    Sreekanth,
       If Record creation date is the right field for deriving fiscal year, Why cant you derive the year from the date...by using automatioc time conversion...?? In update rules...??
      For exising data, you can do loop back to populate the data. see the below doc, for more info:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f421c86c-0801-0010-e88c-a07ccdc69601
    Hope it Helps
    Srini
    Message was edited by: Srini

  • How can I load data with Scripts on *FDM* to a HFM target System????

    Hi all!
    I need help because I can´t find a good guide about scripting on FDM. The problem I have is the next one.
    I have on mind to load my data with data load file in FDM to a HFM target system, but I would like to load an additional data using an event script, ie after validate. I would need any way to access to HFM system though FDM Scripts, is it possible??
    If so, It would be wonderful to get a data from HFM with any Point of View, reachable from FDM Scripts in order to load or getting any data.
    I´ve looking for a good guide about scripting in FDM but I couldn´t find any information about accessing data on HFM target system, does it really exist?
    Thanks for help

    Hi,
    Take a look at the LOAD Action scripts of your adapter. This might give you an idea.
    Theoretically it should be possible to load data in an additional load, but you need to be very careful. You don't want to corrupt any of the log and status information that is being stored during the load process. The audit trail is an important feature in many implementations. In this context it might not be a good idea to improve automation and risk compliance of your system.
    Regards,
    Matt

  • How to regularly load data from .csv file to database (using apex)

    Hi,
    i am using apex3 , I need to load data from a csv file to apex . I need to perform this automatically through code at regular time interval of 5-10 seconds.
    Is it possible .If yes how ?. Please reply as early as possible. This will decide whether to use apex or not for this application.
    this is question for Application Express. Dont know why in forum for BPEL
    Edited by: TEJU on Oct 24, 2008 2:57 PM

    Hello,
    You really need to load the data every 5-10 seconds? Presumably it's read only?
    I would look at using an Oracle external table instead, that way you just drop your CSV in a location the DB can read it and then you build a table that essentially references the underlying CSV (that way when you query the table you view the data in the CSV file).
    Take a look at this link for a quick example on usage -
    http://www.oracle-base.com/articles/9i/SQLNewFeatures9i.php#ExternalTables
    Hope this helps,
    John.
    Blog: http://jes.blogs.shellprompt.net
    Work: http://www.apex-evangelists.com
    Author of Pro Application Express: http://tinyurl.com/3gu7cd
    REWARDS: Please remember to mark helpful or correct posts on the forum, not just for my answers but for everyone!

  • How to check loaded data Master Data Hierarchy?

    Hi
    Please let me know the way of checking available data which was loaded into the Master data hierarchy objects.
    when i go into that particular infobject's hierarchy it is showing maintain hierarchy in its infoprovider execute function colum. How to see the data of it. coz i have to cross check whether the data has been loading/not.
    Thanks

    Hi,
    For Example:
    If its a 0Customer Info Object , then in the 0Customer hierarchy table data can be checked in the H - table.
    That is in the 0Customer info object in the Hierarch Tab there will Hierarchy table /BIC/HCUSTOMER when you double click it you can see the data loaded to it.
    Regards,
    Adhvi

  • How I can Load Data in Excel File On Table in Pl/SQL

    Dear All
    I have Excel File and I need To Load Data on Table Using PL/SQL.
    How I Can It.
    Thanks In advance.

    user8942603 wrote:
    load data
    infile 'C:\Documents and Settings\pc computer\Desktop\calling code.csv'
    into table MSR_CALLING_CODE
    fields terminated by "," optionally enclosed by '"'
    ( code,COUNTRY )
    When Use this Code the error Occurred
    ERROR at line 1:
    ORA-00900: invalid SQL statement
    what the problemThat's because you have to set up SQL*Loader with a a control file and then run the sqlldr command from the command line. It's not an SQL command.
    If your file is CSV you would be better using external tables instead, although that means that your data will have to be on the database server first.
    If the file is located on your local computer then you would have to use SQL Loader.

  • How can i load data from access database to datagridview with custom columns all days of a month ?

    Hi guys
    I am newbie in vb net and I want your help to solve a problem.
    I have this datagridview with two columns and all days of a month in custom columns.
    [IMG]http://i59.tinypic.com/2qwpj15.png[/IMG]
    I also have one combobox to change Year and a combobox to change Month.
    Here is the code to load data
    Private Sub fill_plan()
    dgMonth.Rows.Clear()
    Try
    Dim i As Integer = 0
    Dim query As String = "SELECT MonID,Unitname,Personel,Udate FROM tblMonth ORDER BY Unitname"
    con.Open()
    cmd = New OleDbCommand(query, con)
    myDR = cmd.ExecuteReader
    If myDR.HasRows Then
    While myDR.Read
    dgMonth.Rows.Add()
    dgMonth.Rows(i).Cells(0).Value = myDR.GetInt32(myDR.GetOrdinal("MonID"))
    dgMonth.Rows(i).Cells(1).Value = myDR.GetString(myDR.GetOrdinal("Unitname"))
    dgMonth.Rows(i).Cells(2).Value = myDR.GetInt32(myDR.GetOrdinal("Personel"))
    i = i + 1
    End While
    End If
    myDR.Close() : con.Close()
    Catch ex As Exception
    MsgBox(ex.Message, MsgBoxStyle.Critical, "Error")
    End Try
    End Sub
    With
    this code the
    personel column
    loads the first
    day of the month.
    I want to load
    the column the date that is
    in the database.

    Hello,
    This can be done with less code
    Private Sub fill_plan()
    dgMonth.DataSource = Nothing
    Dim dt As New DataTable
    Try
    Dim query As String = "SELECT MonID,Unitname,Personel,Udate FROM tblMonth ORDER BY Unitname"
    con.Open()
    cmd = New OleDbCommand(query, con)
    dt.Load(cmd.ExecuteReader)
    dgMonth.DataSource = dt
    Catch ex As Exception
    MsgBox(ex.Message, MsgBoxStyle.Critical, "Error")
    End Try
    End Sub
    The above loads all rows, if you want to limit the rows placed in the DataGridView this is best done in the SQL via WHERE conditions and/or with SELECT TOP x.
    Formatting of the data is best done via the property window for the DataGridView on whatever column you want too. Using the above you now need to set the data property for each column and set dgMonth.AutoGenerateColumns = False, in the end we end up with
    less code
    edit is there a reason for returning the primary key? If so then using my method we can hide that field but I see no reason for having it in this case
    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

  • How do I load data into my palm??

    Hi
    I was wondering how I can get new data for my database into my palm. I've got a text-database and I want to try to get it in the Palm and make a program for it.
    So my problem is: How can I get data into the mobile device without typing it myself.
    Stillgar

    Take a look at http://forum.java.sun.com/thread.jsp?forum=76&thread=266095 to see a suggestion for a way of creating RMS's on the PC. You could use this to convert your textfile to RMS format.
    Jouster

  • How to dynamically load data from DB in an HTML control present in jsp

    Hi Friends,
    Can anyone help me with this problem:
    I am working on a portal application. My requirement is to dynamically load data in an HTML control present in my JSPs. The controls are combo-boxes, text-fields, list-boxes etc. . Also, the events to load the data are like On Form load, On selecting a value from the combo-box, on clicking on a text-field etc.
    If any one can help me with a code snippet, than that would be highly appreciable. If not then the approach to achieve this will also be helpful.
    Thanks and Regards,
    Gaive.

    Refer
    http://www.developer.com/db/article.php/3384201
    http://www.developer.com/db/article.php/10920_3399331_1

  • How we can load data selectively?

    Hi all
    in 3.x we can load data selctelively by checking the check box when filling the transfer structure.
    like in BI whrere we will give this option in DTP?

    yes you can certainly put the filters in DTP filter area.
    here is the pseudo code for filter program
    ata: l_idx like sy-tabix,
          date_low  like sy-datum.
    read table l_t_range with key
         fieldname = 'LOAD_DATE'.
    l_idx = sy-tabix.
    date_low = sy-datum - 1.
    l_t_range-SIGN = 'I'.
    l_t_range-OPTION = 'BT'.
    l_t_range-LOW = date_low.
    l_t_range-high = SY-DATUM.
    modify l_t_range index 1.
    bhaskar

  • How to to load data from a flat file in selection screen in portal .

    Dear All,
    I have a question to share : In BEX analyzer i know how i can upload multiple data in selection screen through a flat file , for example if i have to load 200 materials at one go in the selection screen, i can do that in BEX Analyzer . But if i run the same report through portal i am not able to find the upload option through flat file ..... Am i missing some option here ?
    Thanks & Regards,
    Ashutosh Singh

    You will not be able to load through the portal directly. it is possible to load if you can create Visual composer model. that also you will not be able to upload in bulk.

  • How to batch load data to several tables

    Hi,
    One customer have such data structure and have large number of data(arround 10 Million). I think it's proper to convert them to data that SQL loader can recognize and then insert into Oracle 8 or 9. The question is how to convert?
    Or maybe to insert them one by one is simpler?
    1:     Component of Data
    The data file consists of nameplate and some records.
    1.1 Structure of nameplate
    ID     datatype      length(byte)     comments
    1     char     4     
    2     char      19     
    3     char      2     
    4     char      6     records in this file
    5     char     8     
    1.2 structure of each record
    ID     datatype     length(byte)
    1     char     21
    2     char     18
    3     char     30
    4     char      1
    5     char 8
    6     char      2
    7     char      6
    8     char      70
    9     char      30
    10     char      8
    11     char      8
    12     char      1
    13     char      1
    14     char      1
    15     char      30
    16     char      20
    17     char      6
    18     char      70
    19     char      5
    24     bin(blob)     1024
    25     bin(blob)     defined in ID19
    2: data file and table spaces in database
    dataID 1-13 of each record insert to table1,
    14-18 to table2, and 19,24,25 to table3
    Is there a method to convert them to some data that SQL loader can input and then at a whole load into Oracle 8 or 9?
    Thanks &Regards.

    I've check the Oracle Utilities docs, but did not find a way to load so many data files at a batch action.
    In my view the solution consist in two ways:
    1, Load each of them individualy individually to different tables by some programme. But the speed may be problem because the uninterrupted db connections and close.
    2, Convert them to one or three files then use SQL loader.
    But either isn't much easy, I wonder if there's a better method to handle.
    Many thanks!

Maybe you are looking for