97. How Do I Organize My Common Libraries Into Projects?

Поділитися
Вставка
  • Опубліковано 3 січ 2025

КОМЕНТАРІ • 35

  • @OnlyBESTClub
    @OnlyBESTClub 2 роки тому +9

    Could you share with us how you have organised your library directory structure?
    How do you separate library projects from solutions that you develop at directory level?
    Thank you. You're a wonderful contributor.

  • @HollandHiking
    @HollandHiking 2 роки тому +4

    Thank you for answering. I posted this question some time ago. I think your comments and suggestions are very helpful as a general strategy. I will see how to turn them into practice.

  • @Ultimateman
    @Ultimateman 2 роки тому +1

    Love these videos. I always find them interesting & informative.
    Thanks!

  • @jhbonarius
    @jhbonarius 2 роки тому +3

    Also read "clean architecture" by "Uncle Bob" Martin
    In my experience stuff that "should be together" varies over time. So it can even be dangerous to put them together if libraries keep changing. Versioning is very important.
    But you can end up in the situation where you want to use a feature in a newer version of the package, but upgrading breaks your current code, as the API has changed.
    Keep things simple and separated, in my opinion. And don't give every utility class their own nuget package, because you don't want 100s of packages.
    Edit: i was typing this halfway the video. Turns out you mention all of this eventually. Haha

  • @MaryamAv
    @MaryamAv 2 роки тому

    Thank you very much , as u said , balancing is important. It depends to the case what should be done sometimes library sometimes repeating code.

  • @crustydev5561
    @crustydev5561 2 роки тому +1

    A good idea for small pieces of code might be creating custom code snippets in your editor

    • @IAmTimCorey
      @IAmTimCorey  2 роки тому +1

      The only problem with a snippet is if you use it a few times in a few different applications and then you find out that it had a bug, you now need to track down all of the places where you used that snippet to fix them.

  • @ivanjasenov1220
    @ivanjasenov1220 2 роки тому

    Great advice! Good code structure is the key to project longevity and robustness.

  • @piranha1337
    @piranha1337 2 роки тому +2

    If you don't do what Tim says, you get the mess called NPM where every line of code is stuffed into a library.

  • @AbhishekSingh-mh2fg
    @AbhishekSingh-mh2fg 2 роки тому +1

    hey Tim,
    thanks for the all helpful videos, I was wondering if you can start any WPF series(Complete Project)

    • @RalfsBalodis
      @RalfsBalodis 2 роки тому

      ua-cam.com/video/gSfMNjWNoX0/v-deo.html

    • @IAmTimCorey
      @IAmTimCorey  2 роки тому

      The TimCo series builds a complete application using WPF. I also build a WPF application in this course: www.iamtimcorey.com/p/building-a-complete-sqlite-application and in this course: www.iamtimcorey.com/p/building-a-complete-tournament-tracker-application-bundle

  • @torrvic1156
    @torrvic1156 Рік тому

    Thank you so much for explanation of this very important topic Tim!
    Today I started to ponder over this topic and I am banging my head against the wall thinking over as to where should I put my Pomelo.EntityFramework Nugget package. I am using Blazor Server and I want to use Identity along with. Watching at projects you made I noticed that you put Dapper Nugget package into a separate library with DataAccess folder. Can you kindly give me a hint as to where should I put my EntityFramework Nugget package? (to Blazor Server project right away or in a separate library?)

    • @IAmTimCorey
      @IAmTimCorey  Рік тому +1

      I like to keep the UI separated out from the data access and business logic. The UI is the item most likely to change over the years so keeping the logic and data access outside of it allows it to be more easily replaced. It also allows you to expand to additional UIs down the road as well.

  • @justwatching6118
    @justwatching6118 2 роки тому +1

    Nice video and explanation 🙂
    I have suggestion. Can you make video about C# marshaling / Interopservices?
    C# is awesome language. But because it's high level, it has own limitations especially when working with windows forms.
    That allows us to call C/C++ code from win32API and apply for example placeholder in textBox
    And there are a lot of native windows functions which we can call instead of trying to reinvent the wheel
    I know you don't teach magic and edge cases, but this is also part of C# which I sometimes use.

    • @IAmTimCorey
      @IAmTimCorey  2 роки тому +3

      Thanks for the suggestion. Please add it to the list on the suggestion site so others can vote on it as well: suggestions.iamtimcorey.com/

  • @rogerpence
    @rogerpence 2 роки тому +1

    Doesn't this mean (at about 1:42):
    "If one thing relies on another thing, those two should be in the same library," that you'll always have only one library?
    I don't think that's what you meant. If my accounts rec package relies on my general ledger package, they shouldn't be in the same library.

    • @IAmTimCorey
      @IAmTimCorey  2 роки тому

      If the two libraries are tightly coupled, what value is there in having two libraries? If they cannot be used separately, why aren't they one entity?

  • @williamliu8985
    @williamliu8985 2 роки тому

    Here is my thoughts, don`t refactoring the project deeply at the early stage, but preparing for it (organizing the code stucture well, it should be easy and simple to extract these logic into a library or nuget when needed).

    • @IAmTimCorey
      @IAmTimCorey  2 роки тому

      That works when you only have one project, but after your first project you will already have the library. That's why it is often good to think about the bigger picture when designing your NuGet packages so that you take into account what will actually be valuable across applications and what things should just be per-project.

  • @MichaelAge
    @MichaelAge 2 роки тому

    I often forget the code snippet. If i figure out a complex framework code and i know it might be needed more often. A first good step is to safe it as a snippet. And if I realize I use it all the time I think about a library.

    • @IAmTimCorey
      @IAmTimCorey  2 роки тому +1

      The only problem with a snippet is if you use it a few times in a few different applications and then you find out that it had a bug, you now need to track down all of the places where you used that snippet to fix them.

  • @jonathansaindon788
    @jonathansaindon788 2 роки тому

    I was wondering this morning, my Web and Service app are full of copy/pasted constants used by my business logic like : “MED”, “DENTAL”, “HEALTH”… these are insurance categories. Should I put these in a Nuget package since each app has its own pipeline? Im afraid that if we modify or add some we forget it in one of the app.

    • @IAmTimCorey
      @IAmTimCorey  2 роки тому +1

      If those are constants that you use across projects and they don't change independently then that would probably be a good option for a NuGet package.

    • @jonathansaindon788
      @jonathansaindon788 2 роки тому

      @@IAmTimCorey Thanks

  • @puneetdubey7348
    @puneetdubey7348 2 роки тому

    Hey tim please make a video on wpf datagridview row clicked dropdown and select data

    • @RalfsBalodis
      @RalfsBalodis 2 роки тому

      ua-cam.com/video/nKJ_XDoAdtY/v-deo.html

    • @IAmTimCorey
      @IAmTimCorey  2 роки тому

      Thanks for the suggestion. Please add it to the list on the suggestion site so others can vote on it as well: suggestions.iamtimcorey.com/