Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Java
  4. What is Spring like?

What is Spring like?

Scheduled Pinned Locked Moved Java
csharpquestionjavacssalgorithms
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Guys I was thinking to learn Spring but have few questions: --- is it say more difficult to learn than .NET? I am asking this because I want to evaluate: I learned C# and .NET (desktop side and BCL) very easily because of background in C. So if Spring and .NET are more or less similar in terms of programming style and complexity, I could know that I will be fine also with spring. Can you please give me some guide in this direction?

    L K 2 Replies Last reply
    0
    • L Lost User

      Guys I was thinking to learn Spring but have few questions: --- is it say more difficult to learn than .NET? I am asking this because I want to evaluate: I learned C# and .NET (desktop side and BCL) very easily because of background in C. So if Spring and .NET are more or less similar in terms of programming style and complexity, I could know that I will be fine also with spring. Can you please give me some guide in this direction?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Member 12061600 wrote:

      is it say more difficult

      That is impossible to answer objectively, because much depends on the individual. The only way to find out is to read some of the overview materials: Java Spring - Google Search[^]

      1 Reply Last reply
      0
      • L Lost User

        Guys I was thinking to learn Spring but have few questions: --- is it say more difficult to learn than .NET? I am asking this because I want to evaluate: I learned C# and .NET (desktop side and BCL) very easily because of background in C. So if Spring and .NET are more or less similar in terms of programming style and complexity, I could know that I will be fine also with spring. Can you please give me some guide in this direction?

        K Offline
        K Offline
        Kimberly Weldon
        wrote on last edited by
        #3

        Basically Spring is a framework for dependency-injection which is a pattern that allows to build very decoupled systems. For example, suppose you need to list the users of the system and thus declare an interface called UserLister:

        public interface UserLister {
        List<User> getUsers();
        }

        And maybe an implementation accessing a database to get all the users:

        public class UserListerDB implements UserLister {
        public List<User> getUsers() {
        // DB access code here
        }
        }

        In your view you'll need to access an instance (just an example, remember):

        public class SomeView {
        private UserLister userLister;

        public void render() {
            List<User> users = userLister.getUsers();
            view.render(users);
        }
        

        }

        Spring (Dependency Injection) approach What Spring does is to wire the classes up by using a XML file, this way all the objects are instantiated and initialized by Spring and injected in the right places (Servlets, Web Frameworks, Business classes, DAOs, etc, etc, etc...). Going back to the example in Spring we just need to have a setter for the userLister field and have an XML like this:

        <bean id="userLister" class="UserListerDB" />

        <bean class="SomeView">
        <property name="userLister" ref="userLister" />
        </bean>

        It is great, isn't it? :cool:

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups