• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Is it good to use auto wire concept for a large scale application?

 
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello friends,

I want to ask that as per the auto wire concept, we need not to use the any entry into xml file of spring configuration. Now as we decide to use this concept for a very large application that is it optimization or is considered as tedious task as it will become very tough to find or track an issue generated.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using it all the time in large applications.

In some cases, it can be difficult to see what exactly gets injected at a certain point. A good IDE can help you with that. I use IntelliJ and it has good support for Spring, it can analyze the Spring configuration and tell me exactly where which beans are defined and how things are wired up. Probably other IDEs can do that as well.
 
SunilK Chauhan
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Jesper de Jong,

As you said It all depends on the IDE we are using. But mostly developers are using Eclipse ide and inside it we need to find the wired classes manually. which makes it tougher to find the exact wired class regarding.
Also there is provision of custom tags for the class. So, after concluding all the scenarios doesn't it make the large application difficult to trace?
 
Saloon Keeper
Posts: 26547
187
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If your IDE is influencing your software design, you really need to think hard about your design process. IDEs can be helpful, but they should be aids, not crutches that make you forget how to walk on your own (or worse yet, never learn).

Autowiring default behavior is quite straightforward. If you annotate a property with the @Autowired tag, then the Spring factory will located/construct a bean with that same name when it constructs the target bean. If you adhere to the default naming convention where the bean name is the same as its class name, with the first character translated to lower-case, then you don't have to guess.

The tricky parts only apply if you either override the annotations or you override/autowire from an external source such as a Spring application properties XML file. And that's because you have to look in 2 files instead of just the (annotated) one.

You can save a lot of grunt work by using auto-wiring, as long as you do it judiciously, Large applications are in some ways better for such shortcuts than small applications, since you save so much more work (and potential complexity). As long as you're consistent and straightforward.
 
reply
    Bookmark Topic Watch Topic
  • New Topic