Contents
When to use the same interface in different projects?
For example if a clients send a User data to server, then the server should operate on the same class. The same with interfaces etc. Moreover, if there are any changes in a common interface, both projects should adjust its code to the new situation.
How does a client communicate with a server?
The client uses the network as a way to connect with and speak to the server. Just as the customer speaks to his server, the client uses the network to send and receive communications about its order, or request. The server will take the request and make sure that the request is valid.
How to share classes and interfaces in Java?
But both of us should use some common interfaces like User or AccountInfo or ChangableAccount whatever in order to ensure a compatibility. For example if a clients send a User data to server, then the server should operate on the same class. The same with interfaces etc.
How does a client connect to a network?
The client uses the network as a way to connect with and speak to the server. Just as the customer speaks to his server, the client uses the network to send and receive communications about its order, or request.
You could create a library project that has this class this way all you have to do is add a reference to that project. If that is no option you could use “Right click -> add existing item -> Add as link” this way you only have one copy of the code but it can exist in multiple projects.
If you’re attempting to share code between two different project types (I.e.: desktop project and a mobile project), you may look into the shared solutions folder. I have to do that for my current project as the mobile and desktop projects both require identical classes that are only in 1 file.
https://www.youtube.com/watch?v=4sxyDXt1igs