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 3360650
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T03:01:03+00:00 2026-05-18T03:01:03+00:00

I am currently struggling with whether or not I’ve achieved a good level of

  • 0

I am currently struggling with whether or not I’ve achieved a good level of separation, or if I’ve missed the point somewhere, as I am relatively new to learning the disciplined side of development…

My goal when I started was to create a layer that was agnostic of any persistence mechanism – I called this data-api. I then implemented these interfaces using JDO, and called this project data-jdo. The logic layer ideally talks only is aware of data-api.

This is the point where I’m not sure what makes sense. The business logic layer has to be invoked somehow, right? So is the expectation that the implementation of the data-api (data-jdo, or something else depending on experimentation) is provided (appropriate to say/do injected?) by the invoker?

So the goal would be to (largely for experience and not for productivity) maybe, implement a data-jpa package that could be substituted in place of data-jdo. So the topmost layer (a web service, generic main method as part of a tool, unit tests, whatever) are the ones to make the choice which implementation to use.

Should I be using some framework like Spring to allow me to choose which implementation of my data-api is used, via XML?

Sorry if that’s a little vague… I guess the root question is, at what point does the consumer of an API depend on, supply, or become paired with, the implementation of that API? If the answer is or should be “never” then what is used to make sure everything is available at runtime and how does the consumer get an instance of whatever the “API” is describing with only interfaces?

  • 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-18T03:01:04+00:00Added an answer on May 18, 2026 at 3:01 am

    I come from a .net background – not a Java one, so I’m afraid I can’t help you with Java specifics.

    The business logic layer has to be invoked somehow, right? So is the expectation that the implementation of the data-api (data-jdo, or something else depending on experimentation) is provided (appropriate to say/do injected?) by the invoker?

    Yes. In the .Net world I use a Factory (as in an instance of the Factory Pattern) that dynamically returns the data provider implementation (which one of those to use is set by config). The data provider is returned by the factory as an ‘object’ and it’s up to the calling business logic code to cast it to the correct type – as specificed by the interface that the business logic is working against.

    I’v egot (another!) article on Dependency Injection for .Net which might help explain with some of the issues, but I’m sure there are good java based ones around somewhere.

    Should I be using some framework like Spring to allow me to choose which implementation of my data-api is used, via XML?

    Probably. I’d say spend your time getting to grips with the concepts first, worry about “best practice” after that. FYI, I learnt AJAX the hard way – by writting all the code myself. These days I’d run straight to a good framework, but I only think I have the confidence to do that after having really grokked the basics by doing some hard graft at the coal-face 🙂

    … If the answer is or should be “never” then what…

    Yeah – it’s never. Use a Factory.

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

Sidebar

Related Questions

I'm currently struggling with this Collection was modified; enumeration operation may not execute issue.
I'm pretty new to cocoa for Mac development. I'm currently struggling with getting a
I´m pretty new to Spring, and I´m currently struggling with an exception being thrown
Because I'm currently struggling to learn IBM Rational ClearCase, I'd like to hear your
I'm currently struggling to use UI elements in Interface Builder. I keep trying to
I am currently struggling with HTTP Session replication on tomcat with complex objects. Some
I'm currently struggling with different resolutions when building my gallery-application . I've realized the
I'm currently struggling with the development of a todo list (mostly unimportant) within which
My math classes are far behind, and I'm currently struggling to find a decent
Currently I am struggling a little with the Unit test framework... what I am

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.