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. Product Lifecycle
  3. Application Lifecycle
  4. Shared/Common code and Source Control

Shared/Common code and Source Control

Scheduled Pinned Locked Moved Application Lifecycle
toolshelpquestion
7 Posts 5 Posters 6 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.
  • C Offline
    C Offline
    cjb110
    wrote on last edited by
    #1

    I'm wondering how other people manage common, utility or shared code? Say some extension method's etc. Do you just add a file with this code and share it amongst your projects? Do you have a snippet type program and just copy/paste into/out of that? Or do you build up a separate library and reference that? If you do the latter how much do you put in, i.e. do you think there's an issue with that library containing much more code than you need?

    Kornfeld Eliyahu PeterK B J D 4 Replies Last reply
    0
    • C cjb110

      I'm wondering how other people manage common, utility or shared code? Say some extension method's etc. Do you just add a file with this code and share it amongst your projects? Do you have a snippet type program and just copy/paste into/out of that? Or do you build up a separate library and reference that? If you do the latter how much do you put in, i.e. do you think there's an issue with that library containing much more code than you need?

      Kornfeld Eliyahu PeterK Offline
      Kornfeld Eliyahu PeterK Offline
      Kornfeld Eliyahu Peter
      wrote on last edited by
      #2

      By definition common code can not be snippet - snippet is for repeated code structures not for repeated code! IMHO the best way is a separate library. I'm also do such utility methods stateless an static. I'm also think that there is no such a thing too large library - it only a matter of code organization. There is nothing wrong with a single library with thousands of methods (if the project requests it) as long as the methods are organized...

      I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)

      "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

      C 1 Reply Last reply
      0
      • C cjb110

        I'm wondering how other people manage common, utility or shared code? Say some extension method's etc. Do you just add a file with this code and share it amongst your projects? Do you have a snippet type program and just copy/paste into/out of that? Or do you build up a separate library and reference that? If you do the latter how much do you put in, i.e. do you think there's an issue with that library containing much more code than you need?

        B Offline
        B Offline
        Bernhard Hiller
        wrote on last edited by
        #3

        Similar to Eliyahu, I prefer a Utility library for such code. I'd write one file for each type which gets extended by an extension method (my way of code organisation). Similarly, other utility methods get grouped into files by their underlying business object.

        1 Reply Last reply
        0
        • Kornfeld Eliyahu PeterK Kornfeld Eliyahu Peter

          By definition common code can not be snippet - snippet is for repeated code structures not for repeated code! IMHO the best way is a separate library. I'm also do such utility methods stateless an static. I'm also think that there is no such a thing too large library - it only a matter of code organization. There is nothing wrong with a single library with thousands of methods (if the project requests it) as long as the methods are organized...

          I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)

          C Offline
          C Offline
          cjb110
          wrote on last edited by
          #4

          Thanks for that, I went down that route, and created a set of libraries by function (IO/data/etc) rather than one large single library.

          Kornfeld Eliyahu PeterK 1 Reply Last reply
          0
          • C cjb110

            Thanks for that, I went down that route, and created a set of libraries by function (IO/data/etc) rather than one large single library.

            Kornfeld Eliyahu PeterK Offline
            Kornfeld Eliyahu PeterK Offline
            Kornfeld Eliyahu Peter
            wrote on last edited by
            #5

            You may consider an other addition to that... I'm creating my libraries in a totally different solution (no as part of my main development solution) than create a local nuget package from the outcome and add it as reference - that handles me all the necessary dependencies an updates every time I update the util libraries...

            I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)

            "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

            1 Reply Last reply
            0
            • C cjb110

              I'm wondering how other people manage common, utility or shared code? Say some extension method's etc. Do you just add a file with this code and share it amongst your projects? Do you have a snippet type program and just copy/paste into/out of that? Or do you build up a separate library and reference that? If you do the latter how much do you put in, i.e. do you think there's an issue with that library containing much more code than you need?

              J Offline
              J Offline
              jschell
              wrote on last edited by
              #6

              Depends. First, one be sure that the shared code really should be shared. The fact that it seems like it is common functionality doesn't necessarily mean that it will remain that way. (Really a bad idea to start adding conditional logic to control different logic flows due to different applications.) Second, how is the rest of the business applications structured. Primary if you have two applications X and Y that you want to use your common code M, do X and Y have their own delivery schedules or are they always delivered together. If they have their own deliver schedules then a common library MUST have its own delivery schedule as well. That is the only way to insure that X is using the version of M that it was developed with and Y is doing the same. Third if different deliver schedules are needed then one must deal with different versioned apps, and if one must deal with git as the source control system then one has a problem since git only deals with that via different repositories. There are additional issues depending on what language is being used and how applications are delivered.

              1 Reply Last reply
              0
              • C cjb110

                I'm wondering how other people manage common, utility or shared code? Say some extension method's etc. Do you just add a file with this code and share it amongst your projects? Do you have a snippet type program and just copy/paste into/out of that? Or do you build up a separate library and reference that? If you do the latter how much do you put in, i.e. do you think there's an issue with that library containing much more code than you need?

                D Offline
                D Offline
                Dominic Burford
                wrote on last edited by
                #7

                I have a separate project in my solution that contains such code i.e. code that is shared across other parts of the application. This can then be distributed as a self contained assembly. If using .NET then you have the option of placing this assembly in the GAC where other applications can also use the same functionality.

                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