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. Folders and Namespaces vs Multiple Assemblies

Folders and Namespaces vs Multiple Assemblies

Scheduled Pinned Locked Moved The Lounge
51 Posts 29 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.
  • realJSOPR realJSOP

    Slacker007 wrote:

    you are copying actual code from one solution/project to another (repeatedly), then you are probably doing something wrong (i.e. put it in its own assembly and re-use that),

    I don't think you understand the differences of which I speak. IN Native C++ solutions, you can actually include external libraries' SOURCE CODE in your new solution, and make changes to it there (ostensibly without breaking other stuff already in use by orther solutions). In .Net solutions, that isn't possible without either opening up the library's project in another instance of Visual Studio, or copying that assembly's code to the new solution. This isn't NEARLY as convenient.

    Slacker007 wrote:

    unless you are working in the WPF world, etc.

    Bingo.

    ".45 ACP - because shooting twice is just silly" - JSOP, 2010
    -----
    You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
    -----
    When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

    S Offline
    S Offline
    Slacker007
    wrote on last edited by
    #27

    John Simmons / outlaw programmer wrote:

    I don't think you understand the differences of which I speak. IN Native C++ solutions, you can actually include external libraries' SOURCE CODE in your new solution, and make changes to it there (ostensibly without breaking other stuff already in use by orther solutions). In .Net solutions, that isn't possible without either opening up the library's project in another instance of Visual Studio, or copying that assembly's code to the new solution. This isn't NEARLY as convenient.

    Why would you want to? Sounds dangerous to me. I suspect that others at Microsoft felt the same way?

    realJSOPR 1 Reply Last reply
    0
    • realJSOPR realJSOP

      This discussion came up at work today, with pretty much everyone falling on the side of using multiple assemblies, but with no viable reason for doing it that way, and most of the time saying, "because I've always done it that way". Beyond utility methods or object extensions living in assemblies that could be added as a reference and that could be used throughout other solutions, what's the point of creating multiple assemblies when a thoughtful arrangement of folders in a single-project solution would be perfectly adequate? It even appears as if Microsoft intended for it to be this way. I suppose an argument could be made in a team environment to more clearly separate concerns and ease source control issues, but even that's kinda flimsy at the heart of it.

      ".45 ACP - because shooting twice is just silly" - JSOP, 2010
      -----
      You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
      -----
      When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

      R Offline
      R Offline
      R Giskard Reventlov
      wrote on last edited by
      #28

      Yes. No. Maybe.

      1 Reply Last reply
      0
      • P Pete OHanlon

        Errm, you can self host NuGet so it is a perfectly valid suggestion. For internal deployment of referenced assemblies, NuGet isn't a bad solution.

        This space for rent

        S Offline
        S Offline
        Stephen Gonzalez
        wrote on last edited by
        #29

        It's not for us. We don't want to put our library for public usage. It remains in our org. That's makes it idiot.

        T P 2 Replies Last reply
        0
        • S Slacker007

          John Simmons / outlaw programmer wrote:

          I don't think you understand the differences of which I speak. IN Native C++ solutions, you can actually include external libraries' SOURCE CODE in your new solution, and make changes to it there (ostensibly without breaking other stuff already in use by orther solutions). In .Net solutions, that isn't possible without either opening up the library's project in another instance of Visual Studio, or copying that assembly's code to the new solution. This isn't NEARLY as convenient.

          Why would you want to? Sounds dangerous to me. I suspect that others at Microsoft felt the same way?

          realJSOPR Offline
          realJSOPR Offline
          realJSOP
          wrote on last edited by
          #30

          Recompiling a project in an external solution that's referenced in your current solution causes reference problems in your new solution, Pain.In.The.Ass.

          ".45 ACP - because shooting twice is just silly" - JSOP, 2010
          -----
          You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
          -----
          When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

          1 Reply Last reply
          0
          • realJSOPR realJSOP

            This discussion came up at work today, with pretty much everyone falling on the side of using multiple assemblies, but with no viable reason for doing it that way, and most of the time saying, "because I've always done it that way". Beyond utility methods or object extensions living in assemblies that could be added as a reference and that could be used throughout other solutions, what's the point of creating multiple assemblies when a thoughtful arrangement of folders in a single-project solution would be perfectly adequate? It even appears as if Microsoft intended for it to be this way. I suppose an argument could be made in a team environment to more clearly separate concerns and ease source control issues, but even that's kinda flimsy at the heart of it.

            ".45 ACP - because shooting twice is just silly" - JSOP, 2010
            -----
            You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
            -----
            When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

            I Offline
            I Offline
            Ian Shlasko
            wrote on last edited by
            #31

            I'm working with a suite of tools, all sharing a common framework. I tend to split things up into assemblies based on their general use... One assembly for market data interfaces, one for product valuation, one for my data access layer, etc. The advantage is that different projects only pull in the assemblies they need, so when I'm making a change, it's easier to see the potential downstream effects. If I'm modifying my "Base" assembly (Pretty much the hub of the entire framework), I know to be a LOT more careful not to make any breaking changes. If I'm working on an assembly that's only used by one non-critical application, I can save time and play it a bit looser (RAD environment, so patches can be released in minutes instead of days). Technically I could do the same thing with namespaces, but it's a lot easier to look at DLL references than to scan an entire project to see which namespaces it touches. Also, as a side benefit, I make heavy use of 'internal' classes. While various parts of an assembly might interact which each other, I maintain careful control of which parts are actually public. That way I can look at each assembly as black box, and minimize the danger of breaking other parts of the system. TL;DR;: I use assemblies as another level of encapsulation, to minimize regression issues.

            Proud to have finally moved to the A-Ark. Which one are you in?
            Author of the Guardians Saga (Sci-Fi/Fantasy novels)

            1 Reply Last reply
            0
            • D Duncan Edwards Jones

              Used carefully, internal (Friend) classes, methods and so on can be a useful tool for controlling who uses what and that capability is lost to you if you have everything lumped into one large assembly.

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

              That's what protected and private are for.

              #SupportHeForShe Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun

              1 Reply Last reply
              0
              • realJSOPR realJSOP

                johannesnestler wrote:

                There are ohter technical reasons too... e.g sometimes (for me mostly when working with WPF) I have to split up the Code to different assemblies to "Support" the VS designer. (Better dont try to create and use MarkupExtension in the same assembly..., same with (themed) resources, UserControls etc.)

                Dontcha wish they'd fix that? I have to deal with that as well. Not only that, but don't get me started on the WPF designer's complete inability to resolve XAML references if the source code is on a network share.

                johannesnestler wrote:

                I wonder why you stated that MS intended it to use folder structures instead of more assemblies (which would contradict the name they choose)

                Because they went completely away from code re-use strategy that exists in native C++ code. You could include a library's source code in a solution without having to actually copy that library's source code to the new solution. I found that quite handy (even though we all know that code re-use in its intended form is pretty much a myth).

                ".45 ACP - because shooting twice is just silly" - JSOP, 2010
                -----
                You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
                -----
                When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

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

                John Simmons / outlaw programmer wrote:

                You could include a library's source code in a solution without having to actually copy that library's source code to the new solution.

                You can still do that.

                #SupportHeForShe Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun

                1 Reply Last reply
                0
                • S Stephen Gonzalez

                  It's not for us. We don't want to put our library for public usage. It remains in our org. That's makes it idiot.

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

                  um, the point was, you can make your own PRIVATE nuget repository located on your own server. But whatever...

                  #SupportHeForShe Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun

                  W 1 Reply Last reply
                  0
                  • T TheGreatAndPowerfulOz

                    um, the point was, you can make your own PRIVATE nuget repository located on your own server. But whatever...

                    #SupportHeForShe Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun

                    W Offline
                    W Offline
                    Wonde Tadesse
                    wrote on last edited by
                    #35

                    Nailed it. Was waiting @Pete-OHanlon response this way!

                    Wonde Tadesse

                    P 1 Reply Last reply
                    0
                    • S Stephen Gonzalez

                      It's not for us. We don't want to put our library for public usage. It remains in our org. That's makes it idiot.

                      P Offline
                      P Offline
                      Pete OHanlon
                      wrote on last edited by
                      #36

                      Stephen Gonzalez wrote:

                      We don't want to put our library for public usage

                      That's why I said self-host. You don't have to make it public - if you host it yourself, you can keep it internal. So, perhaps you're being harsh about them calling them idiot. After all, it's not their fault you don't know about how your organisation can host NuGet internally.

                      This space for rent

                      S 1 Reply Last reply
                      0
                      • W Wonde Tadesse

                        Nailed it. Was waiting @Pete-OHanlon response this way!

                        Wonde Tadesse

                        P Offline
                        P Offline
                        Pete OHanlon
                        wrote on last edited by
                        #37

                        Funnily enough, I was just posting.

                        This space for rent

                        W 1 Reply Last reply
                        0
                        • P Pete OHanlon

                          Funnily enough, I was just posting.

                          This space for rent

                          W Offline
                          W Offline
                          Wonde Tadesse
                          wrote on last edited by
                          #38

                          :)

                          Wonde Tadesse

                          1 Reply Last reply
                          0
                          • realJSOPR realJSOP

                            This discussion came up at work today, with pretty much everyone falling on the side of using multiple assemblies, but with no viable reason for doing it that way, and most of the time saying, "because I've always done it that way". Beyond utility methods or object extensions living in assemblies that could be added as a reference and that could be used throughout other solutions, what's the point of creating multiple assemblies when a thoughtful arrangement of folders in a single-project solution would be perfectly adequate? It even appears as if Microsoft intended for it to be this way. I suppose an argument could be made in a team environment to more clearly separate concerns and ease source control issues, but even that's kinda flimsy at the heart of it.

                            ".45 ACP - because shooting twice is just silly" - JSOP, 2010
                            -----
                            You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
                            -----
                            When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

                            K Offline
                            K Offline
                            Kevin Marois
                            wrote on last edited by
                            #39

                            Here's a very good reason... If you put classes all inside a project, how do you replace just one class? Put "replaceable" code into their own projects and you get a separate DLL that you can swap out on the fly.

                            If it's not broken, fix it until it is

                            S 1 Reply Last reply
                            0
                            • realJSOPR realJSOP

                              This discussion came up at work today, with pretty much everyone falling on the side of using multiple assemblies, but with no viable reason for doing it that way, and most of the time saying, "because I've always done it that way". Beyond utility methods or object extensions living in assemblies that could be added as a reference and that could be used throughout other solutions, what's the point of creating multiple assemblies when a thoughtful arrangement of folders in a single-project solution would be perfectly adequate? It even appears as if Microsoft intended for it to be this way. I suppose an argument could be made in a team environment to more clearly separate concerns and ease source control issues, but even that's kinda flimsy at the heart of it.

                              ".45 ACP - because shooting twice is just silly" - JSOP, 2010
                              -----
                              You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
                              -----
                              When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

                              G Offline
                              G Offline
                              Gary Wheeler
                              wrote on last edited by
                              #40

                              My product uses separate assemblies for a couple purposes. First are tools and utilities used commonly between the three applications in the product. The second is a little more interesting, in that I use separate assemblies and reflection for a plug-in framework. I have the option of customizing the product by replacing a plug-in assembly if I wish. To some extent this helps me tailor the product at run-time rather than at compile time. I could do all of this without using separate assemblies. Having purpose-specific assemblies gives you a level of organization above that of source file. While I've seen plenty of code that could benefit from more organization, I've seen very little where the organization was overdone.

                              Software Zen: delete this;

                              1 Reply Last reply
                              0
                              • P Pete OHanlon

                                Stephen Gonzalez wrote:

                                We don't want to put our library for public usage

                                That's why I said self-host. You don't have to make it public - if you host it yourself, you can keep it internal. So, perhaps you're being harsh about them calling them idiot. After all, it's not their fault you don't know about how your organisation can host NuGet internally.

                                This space for rent

                                S Offline
                                S Offline
                                Stephen Gonzalez
                                wrote on last edited by
                                #41

                                It wasn't clear like "MFE" guy.

                                1 Reply Last reply
                                0
                                • realJSOPR realJSOP

                                  This discussion came up at work today, with pretty much everyone falling on the side of using multiple assemblies, but with no viable reason for doing it that way, and most of the time saying, "because I've always done it that way". Beyond utility methods or object extensions living in assemblies that could be added as a reference and that could be used throughout other solutions, what's the point of creating multiple assemblies when a thoughtful arrangement of folders in a single-project solution would be perfectly adequate? It even appears as if Microsoft intended for it to be this way. I suppose an argument could be made in a team environment to more clearly separate concerns and ease source control issues, but even that's kinda flimsy at the heart of it.

                                  ".45 ACP - because shooting twice is just silly" - JSOP, 2010
                                  -----
                                  You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
                                  -----
                                  When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

                                  S Offline
                                  S Offline
                                  Super Lloyd
                                  wrote on last edited by
                                  #42

                                  it's a matter of taste.. I noticed many webby people (at least in my previous company, maybe it's a culture thing, hence different in each company) they were the kind who would would create zillion of library with just 2 or 3 classes each. They called it "separation of concerns" you see? I am just glad none of them designed the .NET BCL!!! :omg: ;P As a side note, my preference, I usually put everything with the same dependencies in the same assembly. I.e. ALL general purpose utilities in one DLL All utility related to a UI framework (WPF, WebMVC, Xamarin) in another DLL All reusable business data & model in one assembly finally all views, viewmodel related to an app in the app itself

                                  All in one Menu-Ribbon Bar DirectX for WinRT/C# since 2013! Taking over the world since 1371!

                                  1 Reply Last reply
                                  0
                                  • K Kevin Marois

                                    Here's a very good reason... If you put classes all inside a project, how do you replace just one class? Put "replaceable" code into their own projects and you get a separate DLL that you can swap out on the fly.

                                    If it's not broken, fix it until it is

                                    S Offline
                                    S Offline
                                    Super Lloyd
                                    wrote on last edited by
                                    #43

                                    What prevent you to replace the big DLL as well with a new version of it where just one class changed? Your "use case" need.... some elaboration...

                                    All in one Menu-Ribbon Bar DirectX for WinRT/C# since 2013! Taking over the world since 1371!

                                    1 Reply Last reply
                                    0
                                    • realJSOPR realJSOP

                                      This discussion came up at work today, with pretty much everyone falling on the side of using multiple assemblies, but with no viable reason for doing it that way, and most of the time saying, "because I've always done it that way". Beyond utility methods or object extensions living in assemblies that could be added as a reference and that could be used throughout other solutions, what's the point of creating multiple assemblies when a thoughtful arrangement of folders in a single-project solution would be perfectly adequate? It even appears as if Microsoft intended for it to be this way. I suppose an argument could be made in a team environment to more clearly separate concerns and ease source control issues, but even that's kinda flimsy at the heart of it.

                                      ".45 ACP - because shooting twice is just silly" - JSOP, 2010
                                      -----
                                      You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
                                      -----
                                      When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

                                      J Offline
                                      J Offline
                                      James Curran
                                      wrote on last edited by
                                      #44

                                      Because "utility methods or object extensions living in assemblies that could be added as a reference and that could be used throughout other solutions" should be the vast majority of your code. Your data layer should be in a separate assembly because you'll be using it in the public facing website and on your intranet admin tool. Your business logic should be in a separate assembly, because you'll be using it on the website, the desktop app, the command-line tool, and the mobile app.

                                      Truth, James

                                      1 Reply Last reply
                                      0
                                      • realJSOPR realJSOP

                                        This discussion came up at work today, with pretty much everyone falling on the side of using multiple assemblies, but with no viable reason for doing it that way, and most of the time saying, "because I've always done it that way". Beyond utility methods or object extensions living in assemblies that could be added as a reference and that could be used throughout other solutions, what's the point of creating multiple assemblies when a thoughtful arrangement of folders in a single-project solution would be perfectly adequate? It even appears as if Microsoft intended for it to be this way. I suppose an argument could be made in a team environment to more clearly separate concerns and ease source control issues, but even that's kinda flimsy at the heart of it.

                                        ".45 ACP - because shooting twice is just silly" - JSOP, 2010
                                        -----
                                        You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
                                        -----
                                        When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

                                        P Offline
                                        P Offline
                                        patbob
                                        wrote on last edited by
                                        #45

                                        Reusability. You can reuse the assemblies in another program without having to import all that code. Better yet, you can easily reuse only part of the code, picking and choosing which assemblies you need. Had to do exactly the above recently. We were able to leave out the parts of the code that required Windows UI libraries that don't exist on Linux yet through judicious choice of assemblies.

                                        We can program with only 1's, but if all you've got are zeros, you've got nothing.

                                        realJSOPR 1 Reply Last reply
                                        0
                                        • P patbob

                                          Reusability. You can reuse the assemblies in another program without having to import all that code. Better yet, you can easily reuse only part of the code, picking and choosing which assemblies you need. Had to do exactly the above recently. We were able to leave out the parts of the code that required Windows UI libraries that don't exist on Linux yet through judicious choice of assemblies.

                                          We can program with only 1's, but if all you've got are zeros, you've got nothing.

                                          realJSOPR Offline
                                          realJSOPR Offline
                                          realJSOP
                                          wrote on last edited by
                                          #46

                                          Cross-platform considerations are few and far between. I haven't had to write "cross-platform" code since 1989 using C++, and even then, we abandoned the effort after one application, even though (I thought) it turned out well.

                                          ".45 ACP - because shooting twice is just silly" - JSOP, 2010
                                          -----
                                          You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
                                          -----
                                          When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

                                          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