Hi, When using Persistence frameworks like Hibernate, JPA etc. on the server side, what are the general practices of passing on the data between client and server ? Are there any existing design patterns for the same ?
Thanks.
Hi, When using Persistence frameworks like Hibernate, JPA etc. on the server side, what are the general practices of passing on the data between client and server ? Are there any existing design patterns for the same ?
Thanks.
Client-server, or with the inclusion of database, 3-tier architecture is a design pattern itself. The question is rather which technology should be used in the communication. There are many choices, e.g. HTTP, TCP, UDP, JMS, XMLRPC, RMI, CORBA, C RPC or flash-drives carried by post pigeons. In general, it is advised to
Regarding your question on dependency on the chosen persistence framework, I think there is none. Your choice of using e.g. Hibernate does not enforce or exclude any client-server communication technologies.
Dunno about patterns but i know in a design using for exemple EJB3 with JPA that it's not recommended to pass JPA entities to client threw remote EJB's because proxies stay and it can generate a lot of useless network trafic. You'd better detach your entities or give to client simple value objects.
Ideally, the persistence layer should be quite separate from your client-server comms layer. While not strictly a pattern, the idea here is loose coupling.
As HerQuLe said, you should try to make sure that the data you send between client and server is just POJO style info, rather than serializing a (possibly much more complex) proxy.