Dependency Injection

Content Area - Under the Hood, Part 3

This is last blog post in series under the hood of Content Area. In this blog post we will take a look at how and what exactly could be customizable while content area is being rendered. Where and how developer can hook in, what can be overridden and controlled. Parts in this series: – Part 1: Registration and Discovery – Part 2: Template Selection – Part 3: Extensibility Overview Following parts and pieces can be customizable, changeable or replaced by other code completely: Change renderer - It's possible to change they guy who…

Keep reading

Format Your Exception Message Properly

Not so Nice Failure I was hacking around NServiceBus (NSB) application and came across pretty unpleasant failure from NSB. So in short we were using Unicast bus that basically means that producer-side of the message has to have a configuration set to which NSB endpoint particular message should be sent. In this case we were using Microsoft Azure Storage Queues as physical transport level. In case when you don’t have a particular configuration to instruct NSB where the message has to be delivered you may encounter following exceptional message:…

Keep reading

Pragmatic problem solving – Answer to the EPiServer forum question

At some point I was questioned about how I’m learning and finding the answers. Generally for the learning process a huge inspiration came from “Pragmatic Thinking and Learning: Refactor Your Wetware” by Andy Hunt. Software development happens in your head. Not in an editor, IDE, or design tool. You’re well educated on how to work with software and hardware, but what about wetware—our own brains? Learning new skills and new technology is critical to your career, and it’s all in your head. Walk-through learning and research…

Keep reading

Injected log4net Logger

Blog post is for personal reference for the cases when you need to get instance of some sort of logger from the Logging library you are using. It depends on logging library that you use but usually you may get instance of logger itself by providing some metadata about calling site or producer of the log entries. Code usually looks somewhat similar: private readonly ILog logger = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); As you can see it’s not really ready for injection as it requires concrete type in order to…

Keep reading

FeatureSwitch library 1.0 – Released!

Have you ever wrote the code like following to verify that either you have to disable or enable some functionality base on set of conditions (usually different sources): if(ConfigurationManager.AppSettings["MyKey"] == "true") { // feature is enabled - do something ...; } else { // feature is disabled - do something ...; } or something like this: if(HttpContext.Current != null && HttpContext.Current.Session != null && HttpContext.Current.Session["MyKey"] == "true") { return ...; } FeatureSwitch library should reduce amount of time and code needed to implement feature toggle in unified way. FeatureSwitch library is easily adoptable…

Keep reading