Results 1 to 4 of 4
Like Tree2Likes
  • 1 Post By benji2505
  • 1 Post By benji2505

Thread: how spring framework makes dependency loose coupled

  1. #1
    muni bhaskar is offline Member
    Join Date
    Dec 2016
    Posts
    4
    Rep Power
    0

    Default how spring framework makes dependency loose coupled

    can you please explain how spring framework makes java loosely coupled. I am new to spring. can anyone explain this will be very helpful to me to understand

  2. #2
    benji2505 is offline Senior Member
    Join Date
    Sep 2014
    Location
    MA, USA
    Posts
    398
    Rep Power
    5

    Default Re: how spring framework makes dependency loose coupled

    A tight coupling is a design where classes are highly dependent on each other. Loose coupling is design in which the classes work independently from each other. Loose coupling is usually done by injecting Interface types rather than concrete Class types (also: Spring). The whole idea behind it is to make testing a lot easier.
    muni bhaskar likes this.

  3. #3
    muni bhaskar is offline Member
    Join Date
    Dec 2016
    Posts
    4
    Rep Power
    0

    Default Re: how spring framework makes dependency loose coupled

    Thanks Benji,I got the point I have one more doubt when i am doing a standalone project and i configured beans in xml and i need to load that and I am using class path cml application context. how can i determine the classpath of a project

  4. #4
    benji2505 is offline Senior Member
    Join Date
    Sep 2014
    Location
    MA, USA
    Posts
    398
    Rep Power
    5

    Default Re: how spring framework makes dependency loose coupled

    The classpath tells Java/Spring where to look for the classes that are referenced, e.g. the xml file. The classes and xml files are usually contained in a package hierarchy. Right-click on the package that contains all class/xml file info in your IDE, then click "copy qualified name" and paste it into the ClassPathXmlApplicationContext() constructor. Erase all info that precedes the package info. If you have a package called com.forums.test which contains your myBeans.xml file, it should look something like:

    ApplicationContext myContext = new ClassPathXmlApplicationContext("com/forums/test/myBeans.xml");
    Last edited by benji2505; 12-29-2016 at 06:16 PM.
    muni bhaskar likes this.

Similar Threads

  1. Spring Framework
    By gaurav_072 in forum New To Java
    Replies: 1
    Last Post: 02-15-2016, 07:59 AM
  2. Spring Framework from where?
    By Jack_Tauson_Sr in forum Spring
    Replies: 3
    Last Post: 03-09-2013, 12:16 PM
  3. Spring Framework
    By NoobSaibot in forum New To Java
    Replies: 2
    Last Post: 10-10-2011, 06:47 PM
  4. How to run Queries in Spring framework
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 04-01-2008, 10:42 AM
  5. Replies: 0
    Last Post: 04-01-2008, 10:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •