-
Pattern: Lazy
Description Lazy initialization is the tactic of delaying the creation of an object,the calculation of a value,or some other expensive process until the first time it is needed. Example in .NET : Lazy Learn More Source Code for Microsoft implementation of Lazy SourceCode Lazy Learn More C2Wiki Wikipedia Homework Implement a lazy initialization of a…
-
Pattern: Chain
Description Chain of responsibility pattern allows an object to send a command without knowing what object will receive and handle it. Chain the receiving objects and pass the request along the chain until an object handles it Example in .NET : Chain Learn More Wikipedia Homework Implement a middleware in ASP.NET Core that intercepts the…
-
Friday links 458
Lazy Loading of Related Data – EF Core | Microsoft Learn Introducing the MSTest Runner – CLI,Visual Studio,& More – .NET Blog Quickly create your first prompt in Semantic Kernel | Microsoft Learn We need to talk about digital ownership Should you Stay Technical as an Engineering Manager? Aaron Schlesinger’s Personal Site ByronMayne/SourceGenerator.Foundations: A Source…
-
Pattern: Decorator
Description Decorator allows behavior to be added to an individual object,either statically or dynamically,without affecting the behavior of other objects from the same class. Example in .NET : Decorator Learn More Wikipedia Homework 1. Add a logging to DBConnection . 2. Use by decorating a coffee with milk,sugar,and chocolate (and maybe other condiments). The coffee…
-
Pattern: Facade
Description Facade is is an object that provides a simplified interface to a larger body of code,such as a class library. Example in .NET : Facade Learn More Wikipedia Homework Implement a Facade that will allow you to display a question in a MessageBox with a single method call in a console application and return…
-
Pattern: Factory
Description A factory is a function or method that returns objects of a varying prototype or class from some method call,which is assumed to be new Example in .NET : Factory Learn More Wikipedia Homework having multiple types of drinks( water,tea,coffee) with an IDrink interface create a factory method ( with a parameter ) to…
-
Pattern: Prototype
Description It is used when the type of objects to create is determined by a prototypical instance,which is cloned to produce new objects Example in .NET : ICloneable Learn More Wikipedia Homework Imagine that you have a cow farm and you want to create a new cow. Implement a prototype that will allow you to…
-
Friday Links 457
Lazy Loading of Related Data – EF Core | Microsoft Learn Introducing the MSTest Runner – CLI,Visual Studio,& More – .NET Blog Quickly create your first prompt in Semantic Kernel | Microsoft Learn We need to talk about digital ownership Should you Stay Technical as an Engineering Manager? Aaron Schlesinger’s Personal Site ByronMayne/SourceGenerator.Foundations: A Source…
-
Pattern: Singleton
Description Singleton pattern restricts the instantiation of a class to one object. It is used when you want to have one instance of a class that is shared across the application. Example in .NET : Singleton Learn More Wikipedia Homework Implement a singleton that will allow you to create a single instance of a logger…
-
Pattern: Strategy
Description Strategy pattern allows a client to choose from a family of algorithms at runtime. It is used when the client expects to have multiple algorithms and wants to choose one of them at runtime. Example in .NET : Strategy Learn More Wikipedia Homework Image you want to serialize classes to XML,JSON and CSV .…
I am ok , you are ok