Announcement

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

    SmartGWT - Seam RESTeasy

    I am actually trying to build the interface between my ListGrid and TreeGrid components using the Rest datasource - based on the Seam RESTeasy framework.
    While doing so - there are some questions arising:

    Q1)
    How does the update / create / delete send the data (the whole object) and can i define the URL for that ??

    Q2)
    In the smartclient datasource definition (as far as i understand) i only define the fields i want to show (not the whole object graph)!

    So when now the Grid or List forces an update - what happens with the other values of my Object - are they set to null - or arent they transmitted at all (am i loosing my object graph) ?

    Q3)
    XML or JSON - as in the samples there is mainly used xml - is the xml way the preferrable one ??

    Q4)
    Has someone already made the integration with a Seam server as a backend ?

    Any feedback would be helpful (Thanks in advance) !

    #2
    You basically should not pursue this architecture unless you have no choice and have already exhausted all possible arguments against this architecture. You are looking at doing a lot of extra work (dealing with details of REST and HTTP) in order to arrive at a drastically inferior result (the loss of most of the Pro/EE features due to integrating at the wrong point).

    Go through the Pro/EE showcase - Pro/EE is designed to either provide the complete persistence stack (eg the SQL DataSource) or to be connected to a server-side data services layer.

    Comment


      #3
      But this would mean that i have to deal with a server / server integration which i wanted to avoid - as i then have to deal with two server platforms (seam and Pro/EE) !

      I cannot connect Pro/EE directly to my datasource as i have already an running jsf app (icefaces) - and i now want to switch the client !

      As my data is already available (within seam) - i only need to duplicate the code if i write a server / server integration - or did i miss something ??

      There are mainly 6 examples dealing with xml or json datasource - why is that a bad thing ?

      I already tried the DMI and the ORM Example but this would mean that i have to write DTO`s for over 100 Objects, out of my Object Graph and with REST i can directly display that - with only some lines of code !!

      I would go for a server / server integration if i would see any benefit as actually i only see that i need to duplicate the Object handing !

      Comment


        #4
        Incorrect, the path we're pointing you to is far, far less effort.

        Look closely at the Custom DataSource example that shows integration with Hibernate. In that sample, a single Java class provides access to *any* Hibernate entity - to access each additional Hibernate entity you just create a .ds.xml file.

        You are most likely able to write a similar class that provides access to the same data services you otherwise propose to expose via REST.

        As far as the benefits, it's clear that you still haven't read the basic overview documentation or considered all the samples that are pointed to (or that you just skimmed this part of the docs). Take a look at that to get the very very long list of features this gives you relative to a REST approach.

        Comment


          #5
          Cool - so you point me to implement the datasource not based on the "standard" ones - i should implement one CustomDS which connected to the RESTless services - right ?

          That was very helpfull - thanks (looks like a clever solution) !

          Comment


            #6
            Yes, most likely. You may want to use a mix of the built-in Hibernate DataSource or even the built-in SQL DataSource, and only use your custom DataSource only for special circumstances. All the different types of connectors work in tandem.

            Comment


              #7
              Thanks that helped !
              Regarding the Database integration you mentioned i have one more question regarding their relationship work (to update the database correctly)

              See my post there:
              http://forums.smartclient.com/showthread.php?t=9292

              Can you tell me if that would be possible with the built-in Hibernate / or SQL Datasource ??

              Or do i need to use the REST integration already for making those "joins" work ??


              (As i recognized the Hibernate DS only works with hbmxl files and i used annotations - so i think more about the SQL Datasource)

              Comment

              Working...
              X