Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

URLyBird - Help with server interface Data

 
Fernando Franzini
Ranch Hand
Posts: 489
2
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi jRanchers

In my server interface was specified String array in all methods !!! But i would like to use pojo aproach to deal with GUI layer !!!
So...I need ideias or solutions about that !!!
There is an way or I must use array !!! ???
Regardsss
 
K. Tsang
Bartender
Posts: 3585
16
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
String arrays for ALL methods? Input parms or return value?

If you really need to convert to POJO, you need a conversion class having (static?) methods like


Then in your GUI you can use your Room class instead of working with arrays.
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Fernando,

I followed the same approach as K. Tsang described in his post. So creating an Utils class with 2 static methods: 1 to go from String[] to object and 1 to convert an object to a String[]

Kind regards,
Roel
 
Fernando Franzini
Ranch Hand
Posts: 489
2
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ranchers...thanks for replyss....
Let's see if I undertood.... I'll use static util class to convert array to pojo and vice inside GUI layer.....but the comunications between GUI and Server layer still will be with Array ??
 
K. Tsang
Bartender
Posts: 3585
16
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No not inside the GUI layer. Do the conversion in your service layer or data layer (on the server side). This will make your Room class serializable (pass this object through the network bla bla bla). In the GUI you just have a bunch of Room objects to work with to represent your data for your table.
 
Fernando Franzini
Ranch Hand
Posts: 489
2
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi K.

I'm lost dudeee !! I've thought that I must use Data interface to expose server layer to the GUI !!! or not ?? Or I can create another interface that extends Data interface and write methods (create, update, delete, find etc..) with pojo Room signature....?? Or there are another options solutions ??

Regards.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic