Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7528159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:18:04+00:00 2026-05-30T04:18:04+00:00

Are there any patterns/solutions to solve the problem of having an API call which

  • 0

Are there any patterns/solutions to solve the problem of having an API call which in one scenario may need to return a full object graph (say a manager object and all it’s staff relations) and in another may just return a single manager object?

The ideas we’re currently passing around are:

  1. Many methods
    In the example above you’d have one method called get_manager() and another called get_manager_deep().
  2. Many objects
    Similar to 1. you have two methods, one returns a manager and one returns a manager_with_staff
  3. Data-driven API
    Here the method accepts some kind of query (maybe XML) which defines exactly what kind of object you want back, and the method returns perhaps a dynamic object matching the query.

NB. These examples are very simplified, in reality the methods may need to specify where parts of the data comes from – ActiveDirectory/DB.

Anyone ever come across problems like this?

EDIT – Main driving force of the design is to have a clean and simple (but effective) API and object model. So some of the above examples result in potentially large (and possibly confusing) object graphs. Having too many (hopefully unnecessary) methods/classes can be a maintenance problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T04:18:05+00:00Added an answer on May 30, 2026 at 4:18 am

    You should try creating one according to your needs.. you just need two concepts..
    1. Method Chaining
    2. Recursion

    A really good article of what Method Chaining is at Wikipedia
    http://en.wikipedia.org/wiki/Method_chaining

    Regards.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Are there any known design principles, best-practices and design patterns that one can follow
Are there any patterns or best practices that can be used to simplify changing
Are there any templates/patterns/guides I can follow for designing a multithreaded server? I can't
Are there any commonly used patterns in Javascript for storing the URL's of endpoints
Are there any mnemonics or patterns that make memorizing emacs key combos easier?
Are there any good resources (books, authoritative guides, etc.) for design patterns or other
I have a re-occurring design problem with certain classes which require one-off initialization with
Are there any patterns on how to handle UI Transitions in Android Activities vs
Is there any pattern how to deal with a lot of object instantiations (40k
Is Model-View-ViewModel the best pattern to use in WPF? Are there any downsides?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.