1 Reply Latest reply on Nov 19, 2007 10:26 PM by atta707

    RIA Controller Design, Architecture Question

      I am pretty new to web development, but have been a programmer for quite some time. I am barely getting my arms wrapped around all the different types of web development technology and admittedly don’t understand a lot.

      A little Background ---

      I am kicking around trying to build a controller app, which will have a bunch of hardware attached to a server, running a web server so it can be controlled remotely.

      I think I am going to use ASP.NET and C #for the server side and Adobe Flex for the GUI Client Side because I saw some samples and it looks great.

      The server side will have a database tracking states of all the Hardware attached to server.

      Basic Functionality Needed ---

      When the user clicks a control on the webpage:
      Client sends a message to server, HW state changes on server
      Database gets updated on server
      Client then updates GUI properties in the flex side to reflect new status.

      If something happens to the server side forcing HW status changes:
      Server Sends message to Client
      Database gets updated on server
      Client updates GUI properties in the flex side to reflect new status

      Now the Questions ---

      What happens on initial load, or when no one is accessing the server?

      In other words, I would like the server side to continually update the web page that will be served to the client side so that any time a client access the web server, the GUI reflects the current state.

      I do not want the user to connect, load all the controls in the flex project, and then poll every device on the server side to synchronize the states of all the items on the client GUI to the hardware on the server (this would take forever)

      This question may make no sense at all, due to my lack of understanding about how all this dynamic web page technology works. Can someone clarify this a bit? Anyone have suggestions on how to build this type of page / application properly?

        • 1. Re: RIA Controller Design, Architecture Question
          atta707 Level 2
          Hi Mike,

          > What happens on initial load, or when no one is accessing the server?

          Well, you just show the 'default' view of your hardware state; whatever that might be.

          If server sending updates to the client is a 'real' requirement -- as opposed to client polling server for any changes -- then you should look int the Flex LiveCycle Services; formerly Flex Data Services. Otherwise, consider polling from client after a given interval, get any updates and update the view.

          Let's just say, for the sake of simplicity, that your view depends ONLY on the data stored in the database and NOT on the actual status of the hardware. Here is what you'll need to study:

          1) A server side module that pumps this data to the client as XML, JSON, CSV or some other format. XML and JSON are built-in Flex.
          2) You use the Flex's HttpService class to send a request to the server URL asking for the model you need for your view
          3) You listen for result event and get and parse the data and update your view.
          4) You use the Timer class to schedule calls to your server to get the latest results.

          Hope this would get you started.