Howto structure code used at each end of comms link (server/client ???)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Howto structure code used at each end of comms link (server/client ???)

dazz
Hello

I have a server/client application where a complex object (contained about 20 variables and objects) is created and populated at one end, serialised, then sent across a comms link to a Java app on the other end.

My question relates to how do I structure the project in Netbeans so both the server and client software use the same object class.

I could create a server project and a client project and duplicate the object class.  This would create maintenance problems.

I was wondering if I provided an interface to the code so server and client projects shared the code.




Reply | Threaded
Open this post in threaded view
|

Re: Howto structure code used at each end of comms link (server/client ???)

Thomas Wolf-7
IMO you should create three projects: (1) the object hierarchy you are transferring between the client and server, (2) the client, (3) the server.   The client and server projects can be made to depend on the first project (under Project->Library for those projects, add the first project using "Add Project").

Hope this helps,
tom

> On May 5, 2017, at 10:49 AM, dazz <[hidden email]> wrote:
>
> Hello
>
> I have a server/client application where a complex object (contained about 20 variables and objects) is created and populated at one end, serialised, then sent across a comms link to a Java app on the other end.
>
> My question relates to how do I structure the project in Netbeans so both the server and client software use the same object class.
>
> I could create a server project and a client project and duplicate the object class.  This would create maintenance problems.
>
> I was wondering if I provided an interface to the code so server and client projects shared the code.
>
>
>
>