• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Service Layer design

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am trying to design a service layer. Service layer interacts with many clients via remoting but all the clients related to same business group.
My question is how do I design my service for loose coupling


say client 1 needs

PersonResponseDTO getPersonDetails(PersonDTO)

say client 2 needs
PersonResponseDTO getPersonWithAllHisPets(PersionDTO)


PetResponseDTO getPetsWithNoOwners(PetDTO)


My concern here is, I start having DTO's like this I will end up creating lot of DTO's.
I am afraid this is tight coupling.
How best I can take input from client and give response back.
Since each client need different level of details, do you guys know how best we can achive this?
 
author & internet detective
Posts: 41250
849
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've used a "search criteria" object when I need fine grained control of a search. That way I can add boolean parameters and the like without changing the signature.
 
Sheriff
Posts: 67664
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might wan to take a look at the interfaces that make up Hibernate Criteria. it's a good example of expressing complex search criteria in a Java class hierarchy.
 
Curse your sudden but inevitable betrayal! And this tiny ad too!
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic