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. The Lounge
  3. Building a new Dependency Injection Framework

Building a new Dependency Injection Framework

Scheduled Pinned Locked Moved The Lounge
csharpjavagame-devquestion
13 Posts 11 Posters 1 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.
  • M Offline
    M Offline
    Maruf Maniruzzaman
    wrote on last edited by
    #1

    We already have some good one- Spring.NET, Unity, Castle and more- How much does this worth? Waste of time?

    Maruf Maniruzzaman @ Dhaka, Bangladesh.

    J T T M T 6 Replies Last reply
    0
    • M Maruf Maniruzzaman

      We already have some good one- Spring.NET, Unity, Castle and more- How much does this worth? Waste of time?

      Maruf Maniruzzaman @ Dhaka, Bangladesh.

      J Offline
      J Offline
      Jorgen Sigvardsson
      wrote on last edited by
      #2

      What exactly is a dependency injection framework? :~ Judging by the name along, it doesn't look very useful.

      S J 2 Replies Last reply
      0
      • M Maruf Maniruzzaman

        We already have some good one- Spring.NET, Unity, Castle and more- How much does this worth? Waste of time?

        Maruf Maniruzzaman @ Dhaka, Bangladesh.

        T Offline
        T Offline
        Todd Smith
        wrote on last edited by
        #3

        Maruf Maniruzzaman wrote:

        How much does this worth? Waste of time?

        Filling a niche? Making an improvement? Hard to say... They're usually easy to swap so adoption isn't too hard assuming you bring something beneficial to the table.

        Todd Smith

        1 Reply Last reply
        0
        • M Maruf Maniruzzaman

          We already have some good one- Spring.NET, Unity, Castle and more- How much does this worth? Waste of time?

          Maruf Maniruzzaman @ Dhaka, Bangladesh.

          T Offline
          T Offline
          Tomz_KV
          wrote on last edited by
          #4

          It is new to me. Are all the links automatically added?

          TOMZ_KV

          M 1 Reply Last reply
          0
          • M Maruf Maniruzzaman

            We already have some good one- Spring.NET, Unity, Castle and more- How much does this worth? Waste of time?

            Maruf Maniruzzaman @ Dhaka, Bangladesh.

            M Offline
            M Offline
            Marc Clifton
            wrote on last edited by
            #5

            Maruf Maniruzzaman wrote:

            How much does this worth? Waste of time?

            I've been using Spring.NET and Microsoft's CAB, and have been playing around with my own framework (see my articles on Cx). The two I've used are fine, but they are easily abused: 1. You can create complex instantiation graphs that take forever to initialize and slow down the startup of the application 2. The more complex the instantiation graph, the harder it is to debug 3. It would really be nice if these players invested the time into a designer tool so you can avoid all the mistakes that occur with editing XML directly (for example, I wrote a bare-bones designer for Cx, toot-toot) 4. It would be nice if these players wrote some tools so you could see the instantiation graph. It can take hours (from experience) to understand and document the dependencies 5. Ultimately, the point is to make it easier to swap components and do mocking. Frankly, there are simpler ways to skin that cat, IMO. Anyways, if you read Cx Part II[^], near the top of the article are some Best Practices I've identified. Hope that helps! Marc

            Will work for food. Interacx

            I'm not overthinking the problem, I just felt like I needed a small, unimportant, uninteresting rant! - Martin Hart Turner

            1 Reply Last reply
            0
            • J Jorgen Sigvardsson

              What exactly is a dependency injection framework? :~ Judging by the name along, it doesn't look very useful.

              S Offline
              S Offline
              Shog9 0
              wrote on last edited by
              #6

              Jörgen Sigvardsson wrote:

              Judging by the name along, it doesn't look very useful.

              Heh... If you think that now... wait'll you find out what they are! :rolleyes:

              B P 2 Replies Last reply
              0
              • S Shog9 0

                Jörgen Sigvardsson wrote:

                Judging by the name along, it doesn't look very useful.

                Heh... If you think that now... wait'll you find out what they are! :rolleyes:

                B Offline
                B Offline
                Brady Kelly
                wrote on last edited by
                #7

                I don't know, every time I start a project that requires 'variable' dependencies I have to stop myself building a small one, so what's wrong with an already built one? I love the concept of IoC, but grant that it's often in the YAGNI arena.

                I have been trying for weeks to get this little site indexed. If you wonder what it is, or would like some informal accommodation for the 2010 World Cup, please click on this link for Rhino Cottages.

                S 1 Reply Last reply
                0
                • M Maruf Maniruzzaman

                  We already have some good one- Spring.NET, Unity, Castle and more- How much does this worth? Waste of time?

                  Maruf Maniruzzaman @ Dhaka, Bangladesh.

                  T Offline
                  T Offline
                  TheGreatAndPowerfulOz
                  wrote on last edited by
                  #8

                  look at LinFu, StructureMap, AutoMapper, etc... ad nauseum.

                  1 Reply Last reply
                  0
                  • J Jorgen Sigvardsson

                    What exactly is a dependency injection framework? :~ Judging by the name along, it doesn't look very useful.

                    J Offline
                    J Offline
                    Judah Gabriel Himango
                    wrote on last edited by
                    #9

                    Martin Fowler - Dependency Injection and Inversion of Control[^] Basically, it's a way to remove hard dependencies in your code.

                    Religiously blogging on the intarwebs since the early 21st century: Kineti L'Tziyon Judah Himango

                    1 Reply Last reply
                    0
                    • M Maruf Maniruzzaman

                      We already have some good one- Spring.NET, Unity, Castle and more- How much does this worth? Waste of time?

                      Maruf Maniruzzaman @ Dhaka, Bangladesh.

                      P Offline
                      P Offline
                      Philip Laureano
                      wrote on last edited by
                      #10

                      Maruf Maniruzzaman wrote:

                      We already have some good one- Spring.NET, Unity, Castle and more- How much does this worth? Waste of time?

                      As someone who has written no less than three of them (Click here[^], here[^], and here[^]), I'll have to say that writing your own IOC container can be a very enlightening experience, but be prepared to sacrifice hundreds of hours of your time to put one together. If you're going to build an DI/IOC framework just for the sake of learning how DI/IOC containers work, then go for it--but I don't recommend writing one unless you need to do something that the seven (?) other DI/IOC containers don't already do.

                      Do you know...LinFu?

                      1 Reply Last reply
                      0
                      • B Brady Kelly

                        I don't know, every time I start a project that requires 'variable' dependencies I have to stop myself building a small one, so what's wrong with an already built one? I love the concept of IoC, but grant that it's often in the YAGNI arena.

                        I have been trying for weeks to get this little site indexed. If you wonder what it is, or would like some informal accommodation for the 2010 World Cup, please click on this link for Rhino Cottages.

                        S Offline
                        S Offline
                        Shog9 0
                        wrote on last edited by
                        #11

                        Brady Kelly wrote:

                        I love the concept of IoC, but grant that it's often in the YAGNI arena.

                        That's pretty much my feeling. In the handful of instances where i've found it useful, it was easy enough to achieve without any framework.

                        1 Reply Last reply
                        0
                        • S Shog9 0

                          Jörgen Sigvardsson wrote:

                          Judging by the name along, it doesn't look very useful.

                          Heh... If you think that now... wait'll you find out what they are! :rolleyes:

                          P Offline
                          P Offline
                          peterchen
                          wrote on last edited by
                          #12

                          :laugh: Always to the point, Shog9.

                          Personally, I love the idea that Raymond spends his nights posting bad regexs to mailing lists under the pseudonym of Jane Smith. He'd be like a super hero, only more nerdy and less useful. [Trevel]
                          | FoldWithUs! | sighist

                          1 Reply Last reply
                          0
                          • T Tomz_KV

                            It is new to me. Are all the links automatically added?

                            TOMZ_KV

                            M Offline
                            M Offline
                            Maruf Maniruzzaman
                            wrote on last edited by
                            #13

                            Yes- you create properties for interfaces and then set those value from config file- framework creates new object and set for you- you can switch between implementation of that interface just by changing the config file-you get close to 100% decoupled application- actually a lot more- it worth reading about DI/ IoC whether you use or not: Inversion_of_control[^]

                            Maruf Maniruzzaman @ Dhaka, Bangladesh.

                            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