In object oriented programming, mock objects are simulated objects that mimic the behavior of real objects. Mock objects are usually used in Unit Testing. Mock objects are exactly created to test the behavior of some other (real) object. Therefore, mocking is all about faking the real object and doing some operations in a controlled way so that the returned (test) result is always valid. The first question [... read more]
By continuously improving the design of code, we make it easier and easier to work with. This is in sharp contrast to what typically happens: little refactoring and a great deal of attention paid to expediently adding new features. If you get into the hygienic habit of refactoring continuously, you’ll find that it is easier to extend and maintain code. —Joshua Kerievsky, Refactoring to Patterns[2] [... read more]
Spring.NET is a great open-source framework with rich capabilities and a large amount of “plugins” or services that are implemented around the Spring Core. In this post I am going to discuss the same content discussed in one of the earlier posts (applied to PostSharp framework), which is about how to apply Aspect Oriented Programming specifically the method interception but this time in Spring.NET. I [... read more]
For general information about the Aspect Oriented Programming please refer to the earlier post: Aspect Oriented Programming (AOP) basics In general, PostSharp offers a great deal of different types of predefined aspects that can be used and applied on methods, properties, events, fields, etc. The list below is directly taken from the PostSharp documentation. TypeLevelAspect: Which is a base class for all aspects applied on [... read more]
What is Aspect Oriented Programming? In very simple terms AOP is a software programming technique that helps managing cross cutting concerns in software applications. Before describing what “Cross cutting concern” is, we should mention the Separation of Concerns (SoC) paradigm first: When separating concerns, every class or method should be as modular as possible and should be responsible for only “one” thing at a time. [... read more]
