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.
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.
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
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.
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
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?)
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.
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.
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.
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).
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.
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.
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.
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.
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.
Same questions
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.
You are welcome.
Love these videos. I always find them interesting & informative.
Thanks!
You are welcome.
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
I'm glad we agree.
Thank you very much , as u said , balancing is important. It depends to the case what should be done sometimes library sometimes repeating code.
You are welcome.
A good idea for small pieces of code might be creating custom code snippets in your editor
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.
Great advice! Good code structure is the key to project longevity and robustness.
Thank you!
If you don't do what Tim says, you get the mess called NPM where every line of code is stuffed into a library.
😆
hey Tim,
thanks for the all helpful videos, I was wondering if you can start any WPF series(Complete Project)
ua-cam.com/video/gSfMNjWNoX0/v-deo.html
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
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?)
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.
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.
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/
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.
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?
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).
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.
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.
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.
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.
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.
@@IAmTimCorey Thanks
Hey tim please make a video on wpf datagridview row clicked dropdown and select data
ua-cam.com/video/nKJ_XDoAdtY/v-deo.html
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/