Delegate: pointer to a function Eg. Photo class -> Load and Save methods Photofilters -> Contains different types of filters. Eg., BWFilter, Contrast, Brightness, Resize etc PhotoProcessor -> Takes the path, loads a photo, applies some filters and saves the Photo. If a developer wants to develop a new filter, he has to download the code, create the filter and then make changes to PhotoProcessor. Instead of PhotoProcessor taking the actual filters class, will take a PhotoFilterHandler delegate and will take as parameter. public delegate PhotoFilterHandler(Photo photo); public Photo process(string path, PhotoFilterHandler filter){ photo.Load(path); filter(photo); photo.Save(); } while implementing it create an instance photoprocessor class. Create an instance of PhotoFilterHandler var filterHandler = photoFilter.ApplyBWFilter; filterHandler += photoFilter.ApplyBrightnessFilter; filterHandler += Resize; photoProcessor.process("c:\\photos\\photo1.png", filterHandler); ...
Options pattern https://learn.microsoft.com/en-us/aspnet/core/fundamentals/configuration/options?view=aspnetcore-7.0 OptionMonitor OptionSnapshot IConfiguration Option -> once application is loaded the value will not change. The application has to be restarted. Aws Systems Manager - create parameter store https://www.youtube.com/watch?v=J0EVd5HbtUY
Comments
Post a Comment