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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:58:39+00:00 2026-05-11T08:58:39+00:00

I just inherited a Java application and upon inspection of the code, I’m seeing

  • 0

I just inherited a Java application and upon inspection of the code, I’m seeing what IMHO is a bastardization of the Spring framework. You see, the Java team seems to have an aversion to interfaces, so we end up with things like this:

@Autowired private SomeConcreteFinalClass _myField; 

There’s no Spring configuration, no bean defined, no chance that I can test the containing object in isolation. This is essentially an annotation-based factory with the overhead of Spring.

Am I out-of-line, or is this like using an elephant gun to kill flies? I just have to have a reality check since everyone else on the team thinks this is perfectly acceptable.

Edit In many cases these annotated factories appear in complex processing classes that would benefit immensely from isolated testing. The team also frowns upon testing though.

There’s no mystery here, I hope. If I have a concrete class, that’s not behind an interface, and there’s no corresponding Spring bean to ‘setup’ the object, then it’s inarguably a glorified factory that can be implemented with 10 lines of code.

Spring is not used in any other way in the system; this is it.

My goals right now:

  • Institute a testing policy
  • Educate the team on the virtues of component isolation
  • Move these Autowired fields behind interfaces

I guess the final question is: is there any benefit to keeping these fields Autowired if we’re not testing or in any other way utilizing the framework. I’d just as well new the object if the dependency is immutable.

  • 1 1 Answer
  • 1 View
  • 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. 2026-05-11T08:58:40+00:00Added an answer on May 11, 2026 at 8:58 am

    I would agree with you that this is an abuse of what Spring can do (as opposed to what Spring SHOULD do). Is the person who designed the application this way around? It would be interesting to hear their justification for building an application this way.

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

Sidebar

Ask A Question

Stats

  • Questions 120k
  • Answers 120k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Well, it turned out that it was a resource management… May 12, 2026 at 12:01 am
  • Editorial Team
    Editorial Team added an answer You can do it on the same line as the… May 12, 2026 at 12:01 am
  • Editorial Team
    Editorial Team added an answer On my 32 bit XP system Get-ChildItem \ -Recurse -Include… May 12, 2026 at 12:01 am

Related Questions

I just inherited a Java application and upon inspection of the code, I'm seeing
I've just inherited a java application that needs to be installed as a service
I've recently inherited the job of maintaining a database that wasn't designed very well
Whenever I try to write graphical programs (whether a game or really any GUI
Ted Faison in a podcast on event-based software design mentioned that sender and self

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.