Hello Tim. I'm from Germany and programming in C# since 18 years now. I really enjoy your videos and learned much from you. I just want to say thank you for what you are doing here for us programmers. Videotutorials for free in this amazing quality are rare. So again: Thank you!
@IAmTimCorey
4 жыл бұрын
I appreciate the kind words.
@Berlm
3 жыл бұрын
You're completely right. Most videos of this quality are locked behind paywalls.
@officialspock
4 жыл бұрын
Thanks for this, please discuss all the GOF Design Patterns :)
@IAmTimCorey
4 жыл бұрын
I will add it to the list. Thanks for the suggestion.
@JOHNSONLOBOlobojony
4 жыл бұрын
May be first cover frequently used design pattern's and then others. I am just loving your explanation on topics and encourage you to do more videos on such topics where i can write clean code
@Aprofox
4 жыл бұрын
@@IAmTimCorey Yes Tim, we want more design patterns :)
@saifilali7221
2 жыл бұрын
@@IAmTimCorey is this out there or on your list of things? You are the best instructor.
@jt.633
Жыл бұрын
your videos are long and i am impatient but when I clicked on them you are explaining things so well and are truly tapped into the learner's mindset. Thank you!
@IAmTimCorey
Жыл бұрын
You are welcome.
@gp6763
4 жыл бұрын
I'll try to add some information about Singletons. I came from huge fan of Singletons using them everywhere I could to a moderate user. First I think it is interesting to point out Singletons, as design pattern, are one of the best source of discord and debate between programmers. So Tim, you explained very well why they are useful I'll try to explain why some programmers considers them as an anti-pattern (I disagree with that, but they have some interesting arguments). 1) Multi purpose : A Singleton will always have at least 2 purposes : manage his instantiation and the reason why you create it. So by using it you transgress the single responsibility principle. If you know what you're doing it is not a big deal, but still, at this point you already accept to not keep your code SOLID. 2) Most of the time not the best : This is more a problem for beginners which just learned this pattern That for me the biggest problem with singletons they are easy to use and once you now them you will easily want to use them where they really are not the best. They are able to do a bit to much jobs. 3) Unit testing : That a big one. Yes you can unit test with a Singleton in your workflows. But more the Singleton take importance and more the side effect will be hard to manage at some point testing will become impossible because of the complexity of the state management of your Singletons. Finally, Singleton have some unique behavior making them best pattern for some need. To know if I should use a Singleton I ask myself 3 questions : - Do I really need a Single instance class ? - Do I really need to be able to not instantiate it in run time ? - Does the creation of a factory will really be an overkill investment in my program ? Actually I see 2 feature that will very often have those needs : Loggers and seeders it is most of the time the reason why I'm making singletons.
@IAmTimCorey
4 жыл бұрын
Thanks for sharing.
@mac19999x
4 жыл бұрын
Going to go through some more patterns? Awesome. Damn you're good at explaining these things.
@IAmTimCorey
4 жыл бұрын
Thank you!
@gmt8336
4 жыл бұрын
Ive been writing production level code now for nearly two years now, wasn't until I started watching Tims videos that I realised that I didn't know nada.
@IAmTimCorey
4 жыл бұрын
lol, I'm sure you knew more than that but I am glad my videos are helping.
@jonatancordoba7984
4 жыл бұрын
19:34 This made me click in the sense that we never talk about how to recover the state of a program when it crashes due to, let's say, a power loss... when there's no chance to cancel tasks, close connections and so on. Would be a nice topic to cover.
@IAmTimCorey
4 жыл бұрын
I will add it to the list. Thanks for the suggestion.
@bitsbytesandlife
4 жыл бұрын
That great a explanation of the Singleton Design Pattern. I hope that you are going to do more Design Pattern videos.
@IAmTimCorey
4 жыл бұрын
Thanks!
@jaygarzon6709
3 жыл бұрын
I am here May 2021 This has to be one of the best real life example of singleton pattern that I saw! Thank you sir Tim!
@tomthelestaff-iamtimcorey7597
3 жыл бұрын
Thanks for watching
@Osman-eo1lx
4 жыл бұрын
Thanks for the video. I would expect to hear some stuff about thread safety in your code.
@IAmTimCorey
4 жыл бұрын
I'll be covering thread-safety specifically in an upcoming video.
@gazar37
4 жыл бұрын
@@IAmTimCorey I will be waiting for that :)
@thesazarconfidential
2 жыл бұрын
Thank you Tim
@IAmTimCorey
2 жыл бұрын
You are welcome.
@farizmamad
3 жыл бұрын
Thanks for showing this kind of tutorial in concious way
@rajputanurag124
2 жыл бұрын
Thanks for the detailed lecture. It is really helpful for me to understand why singleton design is followed in making the server based testing frameworks
@IAmTimCorey
2 жыл бұрын
Glad it was helpful!
@refactorear
4 жыл бұрын
Gamma and Johnson (two of the GoF) discussed about this pattern 20 years after the book was released and mentioned they should have reworded the singleton pattern. The way it was presented makes it easy for people to justify making something global which was the main drawback: why have it as a parameter when you can make it global and make the life easier for programmers calling that method. Another drawback is that it makes everything harder to test since you can't stub it directly, you need to wrap it before. Or you need to add a backdoor (like an "internal void overrideServers(List newServers)") to change the internal state of the singleton when testing. On the other side it's useful when dealing with legacy applications where globals are commonly used, you can convert them to singletons (which was the intended way of using it). Personally I rather err on the safe side, I prefer not using it at first but when I detect something is being called way too many times and might be impacting performance (typical example are configurations) I consider using it there.
@IAmTimCorey
4 жыл бұрын
Agreed.
@mangesh4231
3 жыл бұрын
Hi Tim, I have gone through a couple of vedios you made on design principles. Found all of them more explanatory and very useful. Thanks a lot for this.
@IAmTimCorey
3 жыл бұрын
You are welcome.
@Xpert599
7 ай бұрын
All is well when I see my search result returns with a Tim Corey explanation!
@IAmTimCorey
7 ай бұрын
👍🏻
@fcdarjan
2 жыл бұрын
Crazy how my teacher tried to explain this and i just couldnt manage to conprehend it. Now watching this, it makes al sense immedistely..
@IAmTimCorey
2 жыл бұрын
Great!
@devgenesis6436
4 жыл бұрын
Cool video..i love these design pattern series..what bout some microservices and gateway videos for future
@IAmTimCorey
4 жыл бұрын
I will add it to the list. Thanks for the suggestion.
@jfbarbosaboro
4 жыл бұрын
Awesome lecture! Thanks for this!
@IAmTimCorey
4 жыл бұрын
You're very welcome!
@DylanSterling
4 жыл бұрын
"My goal isn't to entertain you." Well, too bad. Great videos. Very educational AND highly entertaining. Thank you for the effort you put into them.
@IAmTimCorey
4 жыл бұрын
lol thanks
@lynndemarest1902
3 жыл бұрын
Simply excellent. Thank you.
@IAmTimCorey
3 жыл бұрын
You're very welcome!
@thethomasproject
4 жыл бұрын
Thanks for the explanation Tim. I initially had to think on the code after seeing it but it makes sense. Kudos on showing the singleton services instantiation in .net core. That's the way to do it there.
@IAmTimCorey
4 жыл бұрын
Glad to help
@joshuajaworowski4258
4 жыл бұрын
Good tutorial on singletons. I have used them in game design to make inventory systems and never thought of using them for other applications. Will you be going over the observer pattern as well? Would love to see your take on that one
@IAmTimCorey
4 жыл бұрын
It is on the suggestion list.
@intellisound
4 жыл бұрын
I’ve been looking forward to this!
@IAmTimCorey
4 жыл бұрын
I hope you enjoyed it.
@farizmamad
3 жыл бұрын
Thanks for showing this kind of tutorial obviously
@tomthelestaff-iamtimcorey7597
3 жыл бұрын
Thanks for watching!
@srinivastanneru1927
3 жыл бұрын
Great Explanation Tim. Thank you!
@IAmTimCorey
3 жыл бұрын
You are welcome.
@vssrikanthgarnepudi5952
4 жыл бұрын
Finally, you did it.
@IAmTimCorey
4 жыл бұрын
Yep.
@bigs2469
4 жыл бұрын
My co-workers need to watch this. "Globals are golden!"
@IAmTimCorey
4 жыл бұрын
Feel free to share. 😉
@AM-rl8lv
4 жыл бұрын
Great video as always!! Keep it up Tim!!
@IAmTimCorey
4 жыл бұрын
Thank you!
@mihaimyh
4 жыл бұрын
Hey Tim, will you make a video/series about data structures and algorithms?
@IAmTimCorey
4 жыл бұрын
Probably. It is on the suggestion list.
@TheAngelOfDeath01
2 жыл бұрын
I don't know... I find these videos both education AND entertaining.... but that's probably just the need inside of me, you know? ;-) And yes. Singletons can very much be one soft cushion too far -- you can easily go overboard very badly. As with EVERYTHING pertaining to programming it's all about picking the RIGHT TOOL for the RIGHT TASK and it's very easy to choose something wrong, and this isn't something you can just learn from reading... this is something you learn through experience, through being responsible for projects and following long term project development because you will rarely see the problems with too many Singletons until way down the road. And to use Singletons scarcely is really the best advice: don't use it unless you absolutely have-to.
@IAmTimCorey
2 жыл бұрын
I'm glad.
@kitsurubami
4 жыл бұрын
"will not get destroyed for the life of your application". What does the application life look like? Like if it were a web-app, does each user create an "application life" when they access the application, and it is killed upon them closing the application? Two application lives can exist concurrently? Sorry if I'm asking an off topic question, but I'm trying to better understand the possible negative side effects of using singleton design pattern. Thank you!
@IAmTimCorey
4 жыл бұрын
For a desktop application, it is as long as the application is open. For a web application, it is as long as the web server is running (technically the website, since you can restart the website without restarting the web server).
@kitsurubami
4 жыл бұрын
@@IAmTimCorey Thank you for that clarification Tim. This might be in part why in my organization restarting the web server is a common thing to try when weird issues pop up.
@artsofsenthu
3 жыл бұрын
Fantastic, thanks for sharing
@IAmTimCorey
3 жыл бұрын
My pleasure!
@cirezno5960
3 жыл бұрын
Thanks a lot Monsieur Tim Corey, I have one question : Suppose that this application is hosted on a IIS Web Server. This means that two users or more calling the server (means more than 2 user sessions) will be using the same TableServers instance ? Thank you.
@IAmTimCorey
3 жыл бұрын
That is correct.
@cirezno5960
3 жыл бұрын
@@IAmTimCorey I never seen good YT channel as yours. I wasted so much time those last 7 years... ..I am learning a lot You deserve to have my patreon. thank so much for your quick feedback. Hi from Fr🇫🇷
@martink4964
4 жыл бұрын
Personally, I find that the benefits of dependency injection (DI) are greater, than the benefit of real singletons. Real singletons can prevent more usage errors, but DI gives a lot more flexibility, and makes it far easier to switch around between singleton, scoped or transient modes for a given class or service. Another important thing to consider with singletons (both real and DI) is multi-threading. If you're using multiple threads, be sure your singleton is thread safe - otherwise you could easily run into errors, or worse, hard to find/debug race conditions.
@IAmTimCorey
4 жыл бұрын
Yep, you need to be careful of threading issues.
@zulhishamtan4263
3 жыл бұрын
Thank you very much for the valuable information. By the way, what is the difference between static class and singleton.
@margosdesarian
4 жыл бұрын
Explaining how AddSingleton differs from the actual pattern is priceless. Does the runtime then manage the resources of the singleton created using AddSingleton efficiently then, do you know?
@IAmTimCorey
4 жыл бұрын
It does. When the first call comes in, it creates the instance. After that, it just hands out that same instance.
@luismendez9436
4 жыл бұрын
excelent tool indeed. Thank you for this.
@IAmTimCorey
4 жыл бұрын
You are welcome.
@jasrobsny
2 жыл бұрын
please do an Angular example project to showcase what's important.
@IAmTimCorey
2 жыл бұрын
I haven't covered Angular up to this point. I've got a ways to go before I consider it.
@arkadiusz6688
4 жыл бұрын
MR. Tim, awesome as always, you'reb eing my programming mentor! My question now is, why in your HTTPClient video you haven't had used the singleton pattern? If you had used it, then we could have the only one instance of HTTPClient and we wouldn't have to have the static one.
@IAmTimCorey
4 жыл бұрын
I didn't want one instance of the HttpClient. I wanted the HttpClientFactory to handle instances so that it would properly close them down and recycle them. This is safer and cleaner.
@bwcbiz
4 жыл бұрын
The singleton class also seems like it could be subject to race conditions in multi-threaded/multi-client environments. I assume a "real" implementation where state transition sequence is important would have to include a mutex implementation..
@IAmTimCorey
4 жыл бұрын
Yes, you would need to add a locking pattern or something similar to make this thread-safe.
@meirkr
4 жыл бұрын
Great video! I just think there should have been some statements about the disadvantages of Singleton. Like testability concerns, direct access from any/to any place which is a risk for spaghetti code, etc. I highly recommend not to use this old singleton pattern. Di really solves those things.
@IAmTimCorey
4 жыл бұрын
Singleton does have its uses but I did caution against overuse in this video.
@leahnjr
2 жыл бұрын
Is it lazy loaded or is it loaded at runtime? I think to lazy load it you need to call it in your GetTablesServers method if it hasn't been instantiated.
@MrLazyleader
3 жыл бұрын
Hey Corey, I am looking for a way to update my Binding of a static property, if it changes. I read that singletons can help, but I don't understand in what way. I still have to tell the code when the property changes. If I create a normal property get the static property value, INotifyPropertyChanged doesn't work since this only works with SetProperty and there is not GetProperty.
@sunnyb7302
2 жыл бұрын
15 mins in the video, you mentioned it's lazy initialisation. Isn't it eager instead of lazy? The static initialisation happens the moment the application is run..
@eslamalshiki2650
4 жыл бұрын
Thanks for this, please discuss CLR & managed code and protect the dll to be deassembly
@IAmTimCorey
4 жыл бұрын
You are welcome.
@pylvr8021
4 жыл бұрын
thanks tim , can we expect a xamarin tutorial this month ?
@IAmTimCorey
4 жыл бұрын
Not this month but it is high on my priority list.
@romedov882
4 жыл бұрын
Thank you for the video! Would it be a good practice to use The Singleton pattern alongside Entity Framework for a database context class?
@IAmTimCorey
4 жыл бұрын
No, that probably isn't a good idea.
@yop6356
4 жыл бұрын
@@IAmTimCorey why?
@bsarge
4 жыл бұрын
Thanks for the video! Singleton has given me a lot of freedom making a bunch of similar utility classes that can implement an interface (which can't be done with static classes, I learned). One question: Does the positioning of the static implementation line matter? Could it be at the bottom of the code block for instance?
@IAmTimCorey
4 жыл бұрын
I am not sure what you mean by static implementation line. If it is a method or constructor or property, no, position does not matter.
@jacobphillips9235
4 жыл бұрын
Nice pattern! Great demonstration! Later on in the video, when you discuss Dependency Injection... would it make sense to load an app's configuration as a DI'd AddSingleton() or AddSingleton()?
@IAmTimCorey
4 жыл бұрын
I prefer to use the interface so that it can be more easily replaced.
@daorsislami9080
2 жыл бұрын
Hi Tim, hope you're doing ok, I wanted to ask you so by all this information is it safe to use SIngleton Design Pattern for seeding data for example city names so that we don't have to do a request in the database each time we want to get data? Thank you!
@fahadmohammad4482
3 жыл бұрын
What is the benefit of using HttpClient as a singleton? I've seen that it is being used in many projects but didn't get the "WHY".
@verttix
4 жыл бұрын
This is pretty cool. Thanks for sharing this. I would love to see something on SignalR, and more specifically how to handle SignalR in a load balanced environment.
@IAmTimCorey
4 жыл бұрын
I will add it to the list. Thanks for the suggestion.
@janne_kekalainen
4 жыл бұрын
Bother, Only 360p at the moment, guess I'll have to come back later.
@MCmotorsports12
4 жыл бұрын
If the video is in 360p it is likely youtube is still rendering the video. It is not the resolution the creator chose.
@LittleCD
4 жыл бұрын
The new "First" comment lol
@IAmTimCorey
4 жыл бұрын
That's just KZitem not updating the video. I had it uploaded for weeks but evidently it waited until it was public to process the rest of the formats. It is 1080p now.
@LaCzHUN
4 жыл бұрын
Are you gonna go through more of the GOF patterns?
@IAmTimCorey
4 жыл бұрын
Possibly. Not sure yet.
@viruslab1
4 жыл бұрын
why i cant do static only nextServer index variable, i think it would work perfectly fine
@IAmTimCorey
4 жыл бұрын
Static classes cannot be stored in variables, cannot implement interfaces, cannot inherit from base classes, and more.
@viruslab1
4 жыл бұрын
@@IAmTimCorey i mean not a whole class but only one variable nextServer
@saurabhchauhan232
4 жыл бұрын
when will be next design patter. Please continue this
@IAmTimCorey
4 жыл бұрын
I don't have a specific plan yet but thanks for your vote.
@vladimirmilatovic
4 жыл бұрын
Great video, but why only in low resolution, it is all blurry? 360p
@refactorear
4 жыл бұрын
Videos take a while to be rendered in KZitem, give it a few hours.
@IAmTimCorey
4 жыл бұрын
That's just KZitem not updating the video. I had it uploaded for weeks but evidently it waited until it was public to process the rest of the formats. It is 1080p now.
@dyakobaram
4 жыл бұрын
hi Tim, I was trying to learn ASP.NET core but there isn't enough tutorial for version 3.1, so my question is, is it ok to watch tutorials below that version like 2.X ? do those version close enough or should I keep looking for version 3.1?
@IAmTimCorey
4 жыл бұрын
It depends on the video but you should be mostly fine with 2.1 videos.
@dyakobaram
4 жыл бұрын
@@IAmTimCorey thank you
@GizToThaMo
3 жыл бұрын
Hey! I'm not receiving an Email with the source code for this specific video. Tried it yesterday and tried again today. Any chance that's getting fixed? Thanks in advance.
@IAmTimCorey
3 жыл бұрын
Send an email to help@iamtimcorey.com with which video you are getting the code for and we will get it to you.
@PinkyParu
4 жыл бұрын
did not understand how you relate DI with singleton for solving the problem? Also you said for getting the weather-forecast using singleton and not using static method, what is the disadvantage of using static methods ?
@gp6763
4 жыл бұрын
The AddSingleton of the DI is very different, the term should not be understand as the design pattern singleton but simply as : "The instance of the class you register as singleton will be unique". The difference between static and Singleton is static will always be instantiate (even if you don't need it) and this instantiation will append before the first line of code came into the stack. However Singleton will be instantiate the first time you call it, and so never take place in RAM if you don't
@IAmTimCorey
4 жыл бұрын
A singleton can be instantiated, it can implement an interface, and it can be passed around as a variable/parameter. You cannot do any of these things with a static class. As for DI, in DI you can essentially turn a class into a singleton by specifying that only one instance will be returned by the DI system. It isn't quite the same, in that you can manually instantiate another instance but if you use DI exclusively then it is functionally the same.
@PinkyParu
4 жыл бұрын
@@gp6763 Thank-you
@PinkyParu
4 жыл бұрын
@@IAmTimCorey Thank you
@ibrahimicgili4254
3 жыл бұрын
Bro thank you...
@IAmTimCorey
3 жыл бұрын
You are welcome.
@LindenMikus
4 жыл бұрын
if host1 and host2 each get the next server async, would you recommend a thread lock in the get next server method or would you prefer something else?
@IAmTimCorey
4 жыл бұрын
Yes, probably a thread lock.
@wiepcorbier
4 жыл бұрын
Thanks 👍
@IAmTimCorey
4 жыл бұрын
You are welcome.
@reodanoe-jankolar1410
4 жыл бұрын
Is the method to get the instance of the singleton necessary or would it also be ok to just make the instance public?
@IAmTimCorey
4 жыл бұрын
You want to control how the instance is returned so that you can, among other things, ensure that the user does not overwrite or change the instance.
@reodanoe-jankolar1410
4 жыл бұрын
@@IAmTimCorey How can the instance be overwritten if it's marked as readonly? Unless there's something I don't know about readonly fields which is possible...
@farsidesc4044
4 жыл бұрын
Hi, Tim! I know you're moving and are working on other Blazor PWA applications. I was wondering if you wouldn't mind looking into a video on merging concepts of the Blazor WebAssembly PWA app, using Azure Functions and Azure SignalR Serverless (also free for limited use), in order to talk to an outside .netcore application (console or otherwise) utilizing the same Azure SignalR Serverless service.
@IAmTimCorey
4 жыл бұрын
I will add it to the list. Thanks for the suggestion.
@hamidrezaashkiyan
4 жыл бұрын
Hooooray. Finally GOF.
@IAmTimCorey
4 жыл бұрын
Yep.
@fredypulido4358
4 жыл бұрын
360p???
@MCmotorsports12
4 жыл бұрын
If the video is in 360p it is likely youtube is still rendering the video. It is not the resolution the creator chose.
@IAmTimCorey
4 жыл бұрын
That's just KZitem not updating the video. I had it uploaded for weeks but evidently it waited until it was public to process the rest of the formats. It is 1080p now.
@fredypulido4358
4 жыл бұрын
So long!, God!.
@IAmTimCorey
4 жыл бұрын
Good explanations take time. Simple explanations often leave out real-world implications.
@BlackBeltMonkeySong
3 жыл бұрын
Pro tip: you never need a singleton.
@IAmTimCorey
3 жыл бұрын
Nah. There is a time and a place where it is valuable. It just isn't nearly as often as people think.
@BlackBeltMonkeySong
3 жыл бұрын
@@IAmTimCorey They are never valuable. You can always use dependency injection. You can always use factory methods, templates, and overload sets to remove the need for additional keystrokes when doing dependency injection. Global state is the enemy of good software engineering.
@dgroh
3 жыл бұрын
Sorry but that is definitely not lazy the way you do.
@tomthelestaff-iamtimcorey7597
3 жыл бұрын
From what I have seen, there is nothing 'lazy' about Tim or how he does things! 😉
@tomthumb2057
4 жыл бұрын
Pointless... I a great illustration on why C# should be stabbed in the head until it is dead :)
@IAmTimCorey
4 жыл бұрын
Nope. Also, you realize this isn't a C#-specific thing, right? The singleton pattern is used in any OOP language.
@rliy001
Жыл бұрын
Omg Such a bad example
@IAmTimCorey
Жыл бұрын
This isn't really helpful or constructive. Is there something that you think is incorrect about the example or something that you think is missing?
@Fergobirck
4 жыл бұрын
Thanks! One question though: wouldn't simply changing 'nextServer' to static in the original code achieve the same result (so the counter is actually shared between all the instances)?
@IAmTimCorey
4 жыл бұрын
A static class cannot be instantiated, it cannot implement interfaces, it can't be passed as a parameter, and it cannot be lazy-loaded. You can't change just the method and access the instantiated value. You would need to make everything static to do that.
@Fergobirck
4 жыл бұрын
@@IAmTimCorey Thanks for the reply, but I'm not talking about making the whole class static, ONLY "nextServer" field static (i.e. take your code as shown at around 6:45 and only change "private int nextServer = 0;" to "private static int nextServer = 0;"). That way no matter how many TableServers you instantiate, the "nextServer" counter will be shared between all instances and you will always get the next "non-busy" server when calling GetNextServer(), no matter on which instance of TableServer (which is the same behavior of the singleton example).
@tailor9639
4 жыл бұрын
@@Fergobirck Im just guessing here...in this case it will produce the same result but you will have two instance of Tableserver and then it will not be a Singleton.
@F4ir8or
4 жыл бұрын
@@Fergobirck the behavior seems to be the same, I agree. The upside of the singleton however is, that you only have one instance of that class loaded and thus it's a bit more resource friendly.
@rahulmathew8713
2 жыл бұрын
One might thing, if the intention is to simple create a single instance of a class why don't we just make the class static instead of implementing singleton pattern. First problem is, what if I want a derived class to have a single instance. A derived class cannot be made Static. Plus static class brings other restrictions in certain scenarios and it wont serve the purpose. So we need a different mechanism to create a single instance class, so we use Singleton pattern.
@ignaciodelaparra
3 жыл бұрын
Hi Tim, Your videos are AWESOME! I have a question. @~24:00, you mention that turning the class to static would bring other complexities that we might not want. What could those be? Thanks!
@alimustafa2088
4 жыл бұрын
thanks sir, i hope to complete all Gang four and please record Repository Pattern with unit of work
@IAmTimCorey
4 жыл бұрын
I will add it to the list. Thanks for the suggestion.
@saeedehbabaiyan8747
2 жыл бұрын
Hello Mr Corey. Thank you so much for this video. Could you please make a video about Abstract Factory Design Pattern?
@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/
@donybg
4 жыл бұрын
Another great video! Can we get Strategy or Repository, please? If you make a course on all major design patterns and some other more advanced topics, that would be awesome.
@IAmTimCorey
4 жыл бұрын
I will add it to the list. Thanks for the suggestion.
@bartekbratus7415
4 жыл бұрын
Really enjoyed that one. I'm looking forward to seeing mode Design Patterns videos. As always I learned something new from your videos, thanks for the great content!
@IAmTimCorey
4 жыл бұрын
Glad to hear it!
@Time21
4 жыл бұрын
Very helpful Tim. Will this playlist has the facade pattern also?
@IAmTimCorey
4 жыл бұрын
That is on the suggestion list.
@deepanshukumar3943
3 жыл бұрын
I m ready to buy also. But please add more patterns.. awesome..
@IAmTimCorey
3 жыл бұрын
The full course is coming.
@UmarAdeeb
4 жыл бұрын
A great example of Singleton is the Application object in an MVC application.
@IAmTimCorey
4 жыл бұрын
Thanks for sharing.
@Laiteux
4 жыл бұрын
Hello Tim, thanks for this amazing video, I truly enjoyed it. However, I recently noticed some noises in the background when you're talking, instead of only having your voice clear. Could you please try looking into it? I find it pretty disturbing. Thank you!
@IAmTimCorey
4 жыл бұрын
I do what I can to eliminate background noise.
@Yanivbd1981
3 жыл бұрын
Brilliantly explained.
@IAmTimCorey
3 жыл бұрын
Thanks!
@umer.on.youtube
2 жыл бұрын
Tim, thanks for valuable content, but please relax on the "KINDA (kind of)" word every now and then. You use it way too much! 😕
@steve-wright-uk
4 жыл бұрын
A nice clear explanation. Looking forward to any other design patterns that you might do. My on criticism is that I probably would have mentioned about two methods calling the GetNextServer at the same time and getting the same server. I would then mention locking strategies that can be used to avoid this.
@IAmTimCorey
4 жыл бұрын
Yes, that is something to consider. I will be covering locking in a future video.
@gami195
4 жыл бұрын
Nice video. Looking forward to other design patterns on Gang of Four.
@IAmTimCorey
4 жыл бұрын
Thanks!
@S3Kglitches
3 жыл бұрын
You should have mentioned what is the difference between using a static class and the singleton patterned class. From the video it isn't clearly visible but it gets clear when you think about dependency inversion. With static classes, it's not possible to pass instances as interfaces (static classes cannot implement interfaces or participate in inheritance). And that becomes important when doing Dependency Injection.
@IAmTimCorey
3 жыл бұрын
Yep, those are important.
@aimanalnami7655
Жыл бұрын
hi tim ' Is the viewmodel the same Builder design pattern thanks
@ppcgnamda
4 жыл бұрын
Excellent as always. Please do the rest of the GoF Design Patterns please!
@IAmTimCorey
4 жыл бұрын
I am planning on doing more.
@yop6356
4 жыл бұрын
Tim used the Dolorean and uploaded the video like in 2008 ^^ 360p style
@IAmTimCorey
4 жыл бұрын
That's just KZitem not updating the video. I had it uploaded for weeks but evidently it waited until it was public to process the rest of the formats. It is 1080p now.
@yop6356
4 жыл бұрын
@@IAmTimCorey thanks :) (for this answer and all of your videos)
@AlThePal78
2 жыл бұрын
I was going to ask too so I am glad you know I actually asked lol
@troymitchel4790
4 жыл бұрын
Do you have any courses that integrate React with Asp.Net Core?
@IAmTimCorey
4 жыл бұрын
I do not. I have not covered JavaScript yet.
@robbiexiong3508
4 жыл бұрын
Be careful of this Singleton. It's awesome, but also dangerous in real world application where there are login sessions and many account users. People could be seeing other people's data. That static keyword means shared variable through the app
@IAmTimCorey
4 жыл бұрын
Agreed.
@robbradley1337
3 жыл бұрын
Singleton is literally just a private constructor. That's it! That's the whole pattern! I have no why you took a potentially 3 minute video and turned into 28 minutes.
@IAmTimCorey
3 жыл бұрын
Thanks for the feedback. I believe in giving context for what I am teaching and that takes time. My goal is not entertainment but true education.
@saiashok28
2 жыл бұрын
I wish I watched your videos at least last few years ago :( . Could you also please suggest good tool for design document? What are the essential applications other than VS a .Net or any developer should have? Please advise.
@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/
@shaswatkumarparida6179
3 ай бұрын
But why use static before the tableservers object creation in program class..is it necessary?
@IAmTimCorey
3 ай бұрын
Yes, it is necessary. The reason it is marked as static is because we want to have only one instance of TableServers. That instance gets created once, and then it will be just referenced from then on.
@yorha2b278
9 ай бұрын
I use singleton design pattern for system that keeps a state machine for the entire app with additional efforts on thread safety for data access.
@IAmTimCorey
9 ай бұрын
Thanks for sharing!
@therealgamer8150
2 жыл бұрын
Logging is the classic singleton use case. I think that would have been clearer than this somewhat odd restaurant situation. But still a good video
@IAmTimCorey
2 жыл бұрын
Logging isn't a great singleton situation because then you cannot get class-specific information to log. Typically we don't use a singleton for logging. For instance, in .NET Core, logging is set up in dependency inject as transient (one instance per class).
@maelvathk
4 жыл бұрын
Hi Tim. Is it good a idea to have a winform as a Singleton?. I need an instance per winform in my application so I was thinking on using this pattern.
@IAmTimCorey
4 жыл бұрын
Typically no, because you want to interact with each instance of the WinForm as if it were unique. If you want them all to be the same, though, a Singleton would work.
Пікірлер: 304