Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Seeking architectural approach/recommendations for scenario

    Hi, I am very new to SmartGWT but I have been going through the showcases and trying to learn how to use it. I am impressed with what I have seen, but I have a scenario that from what I can tell isn't covered by the various examples.

    My scenario is:

    We want to build a wizard-like interface where the user will proceed to create a configuration, step-wise, by making choices.

    Each choice will typically be via a control (combo box, treegrid, etc.) that is populated with values via DataSource connected to a different database table.

    All told, a configuration may involve 15-20 (or more) user choices. The number of choices, the sequence of choices, which choices are available, etc. can vary, possibly widely.

    At the end of the configuration process, we now should be able to query all of the controls and get the set of user choices i.e. "the configuration".

    We want to do several things with this configuration (and this is the root of my question).

    1) Send it to a server, ultimately to be persisted in a set of database tables. The configuration would affect multiple database tables, and the tables are _not_ the same tables as those used to populate/drive the controls above. There may be additional server-side validation and manipulation that needs to be done with the configuration data first.

    2) Evaluate the configuration data, which ultimately results in constructing a set of SQL database queries that are executed against the database. Typically, the queries are "count" queries so the amount of fetched data is not necessarily large. However, it is _not_ something that can be done in a single SQL statement. Instead, it may be 5-10 statements, each of which return a single "count" row.

    3) We would like to return those counts back to the client to be displayed in a ListGrid.

    4) The user can then do further edits by manipulating some of the other values in the ListGrid. This would modify the "configuration data", which has to be packaged up again and sent back to the server for another refresh cycle.


    One of the key things I am trying to figure out is the best approach for getting data from multiple controls, and then "packaging" it in a form that can be sent to the server so that it can be processed, evaluated and persisted. Due to the nature of the configuration data, which would contain structures such as maps and lists, I had been thinking that I would create a DTO to pass back and forth.

    Secondly is the requirement of executing multiple SQL queries, packaging up the results, and returning to a client for display on a ListGrid.

    Technology-wise, from my very ignorant newbie point of view, it looks like the following are my choices:

    1) Use GWT-RPC

    Is this the primary use of RPCManager?

    2) Create a REST web service

    Access via RestDataSource?

    3) Custom DataSource

    Big question: How to pass it a DTO of custom criteria to use when fetching data?

    4) Use DMI

    Not sure how this compares to the other options.



    Since I'm pretty new to all this, I'm not sure how to determine the applicability or the pros and cons of the above options. I realize that what we want to do is a bit different then what seem to be the "typical" usage patterns as shown in the showcase examples.

    Nor am I sure how to determine the "best" architectual approach given the various requirements of my project.

    What I am hoping for is a recommendation for a path to investigate/take on this, so that I don't spend a lot of time pursuing one approach only to find that it is inadequate, or not as efficient to develop as another.

    Any comments would be greatly appreciated.

    #2
    Use the SQLDataSource, and add DMIs where necessary to modify or further validate data before it's committed to SQL.

    Look at the User-Specific Data sample for an example of modifying data before allowing it through to SQL.

    Look at the various samples in the Transactions folder for examples of batching up either multiple query results or multiple saves into a single SQL turnaround.

    You can always take data out of a component that has loaded it from one DataSource, and use DataSource.updateData()/addData() to commit it to another DataSource (and underlying SQL table).

    Once you've been through all of the above, for more specific advice, explain a particular scenario in detail.

    Comment

    Working...
    X