akcoder

Stories kicked by friends of akcoder

Applying aspects to 3rd party assemblies using PostSharp(programmersunlimited.wordpress.com)

submitted by bradygasterbradygaster(4897) 9 months, 29 days ago

There is undocumented functionality in PostSharp 2.1 (2.1.2.3 or higher) that allows us to apply aspects to assemblies that we don’t have the source code for. It is also very, very nifty and demonstrates the power of PostSharp, even when the code isn't available. read more...

add a comment |category: |Views: 40

tags: another

New in PostSharp 2.1: Navigating Code Relationships(www.sharpcrafters.com)

submitted by kingbee71kingbee71(511) 10 months, 1 day ago

Gael Fraiteur covers the second feature of ReflectionSearch: querying the relationships between elements of code. Three kinds of relationships are supported: * type inheritance (classes and interfaces), * usage in statements (a type, method, or field is used inside a method body), * member type. read more...

add a comment |category: |Views: 15

tags: another

New in PostSharp 2.1: Reflecting Custom Attribute(www.sharpcrafters.com)

submitted by kingbee71kingbee71(511) 10 months, 5 days ago

One of the breaking innovations of PostSharp 1.0 in 2005 was the ability to execute aspect code at build time. Whereas other AOP frameworks developed complex declarative syntaxes to express “pointcuts”, PostSharp just allowed you to use System.Reflection to select the target of aspects. LINQ made it even easier to express complex code queries. Yet, some queries were difficult to achieve just with System.Reflection. For instance, it is fairly difficult and inefficient to get all properties annotated with the [DataMember] custom attribute: you have to enumerate all types (and do a recursion on nested types), get all properties of these types, and check the presence of this custom attribute on all properties. Wow. If we were querying a relational database, we would probably create an index on the Type column of the CustomAttribute table. Well, the analogy is not so stupid. Metadata in a .NET assembly is in fact a relational database, and there is a CustomAttribute table. What is more, PostSharp already builds these indexes internally. So why not making them available to user code? This was the principal idea behind this new feature: reflection search. read more...

add a comment |category: |Views: 15

tags: another

Announcing PostSharp 2.1 CTP 3(www.sharpcrafters.com)

submitted by kingbee71kingbee71(511) 10 months, 12 days ago

The third and final Community Technical Preview of PostSharp 2.1 is now available for download on our website and as a NuGet package. read more...

add a comment |category: |Views: 26

tags: another

PostSharp Principles: Day 12 - Aspect Providers, Part 1(www.sharpcrafters.com)

submitted by kingbee71kingbee71(511) 10 months, 14 days ago

When it comes to building aspects, using the provided base classes such as OnMethodBoundaryAspect and LocationInterceptionAspect are quick and easy ways to implement a simple aspect. But they have their limitations: each aspect can only implement one transformation. But what if you need to encapsulate a design pattern made of several transformations? We’re going to look at two ways of building complex aspects: aspect providers today and advices tomorrow. read more...

add a comment |category: |Views: 16

tags: another

PostSharp Principles: Day 11 - EventInterceptionAspect(www.sharpcrafters.com)

submitted by kingbee71kingbee71(511) 10 months, 15 days ago

Dustin Davis previously covered interception for methods and “locations” (fields/properties). Today he'll be finishing up interception by looking at the EventInterceptionAspect. read more...

add a comment |category: |Views: 16

tags: another

PostSharp Principles: Day 10 - Aspect Lifetime & Scope, Part 2(www.sharpcrafters.com)

submitted by kingbee71kingbee71(511) 10 months, 18 days ago

Continuing from yesterday, Dustin Davis covers the lifetime and scope of aspects. Today he looks at the scope of aspects. read more...

add a comment |category: |Views: 9

tags: another

PostSharp Principles: Day 9 - Aspect Lifetime Scope, Part 1(www.sharpcrafters.com)

submitted by kingbee71kingbee71(511) 10 months, 19 days ago

Aspects have a lifetime as well as a scope just like classes in your project. Understanding this cycle is important for producing quality aspects as well as getting aspects to do what you need them to do. Today we’re going to cover the lifecycle. read more...

add a comment |category: |Views: 9

tags: another

PostSharp Principles: Day 7 - Interception Aspects, Part 1(www.sharpcrafters.com)

submitted by kingbee71kingbee71(511) 10 months, 21 days ago

Today Dustin Davis looks at two interception aspects, MethodInterceptionAspect and LocationInterceptionAspect. Due to the nature of the aspects, he breaks it into two parts: today focusing on using them and tomorrow looking under the hood and cover chaining. read more...

add a comment |category: |Views: 10

tags: another

PostSharp Principles: Day 6 - Your Code After PostSharp(www.sharpcrafters.com)

submitted by kingbee71kingbee71(511) 10 months, 22 days ago

Dustin Davis begins week 2 of his PostSharp Principles blog series by exploring two more aspects provided by PostSharp and a look at what is going on under the hood. read more...

add a comment |category: |Views: 26

tags: another

PostSharp Principles: Day 5 - Visual Studio Add-ins(www.sharpcrafters.com)

submitted by kingbee71kingbee71(511) 10 months, 25 days ago

Dustin Davis closes out week one of the series with a look at the Visual Studio add-ins PostSharp provides. read more...

add a comment |category: |Views: 22

tags: another

PostSharp Principles: Day 4 - OnMethodBoundaryAspect(www.sharpcrafters.com)

submitted by kingbee71kingbee71(511) 10 months, 26 days ago

Dustin Davis revisits the OnMethodBoundaryAspect class by building a profiler aspect to identify slow executing methods. As noted in Day 2, OnMethodBoundaryAspect has 4 methods for us to access specific points in a methods execution OnEntry - Before the execution of the method body OnExit - Always called when a method is done executing even if there was an error OnSuccess - Called only when a method is done executing and there were no exceptions OnException - Called only when a method has stopped executing due to an unhandled exception read more...

add a comment |category: |Views: 23

tags: another

PostSharp Principles: Day 3 - Applying Aspects with Multicasting Part(www.sharpcrafters.com)

submitted by mgrovesmgroves(260) 10 months, 27 days ago

Yesterday we started looking at multicasting. Today we’ll go even further with assembly level declarations and how to prevent aspects from being applied. read more...

add a comment |category: |Views: 22

tags: another

PostSharp Principles: Day 2 - Applying Aspects with Multicasting Pt 1 (www.sharpcrafters.com)

submitted by kingbee71kingbee71(511) 10 months, 28 days ago

Dustin Davis continues his series on PostSharp features by writing a how-to on applying aspects with multicasting - giving a clear understanding of multicasting through building a simple tracing aspect that logs the entry and exit of a method as it’s executed. read more...

add a comment |category: |Views: 27

tags: another

PostSharp Principles: Day 1 - OnExceptionAspect(www.sharpcrafters.com)

submitted by kingbee71kingbee71(511) 10 months, 29 days ago

The first in a series of blogs by Dustin Davis on PostSharp features. Each feature will be explored and used in a functioning project to give a better understanding of the examples. This week Dustin uses PostSharp to enhance a simple contact management application while giving readers an introduction to some of the out-of-the-box aspect classes that PostSharp provides. read more...

add a comment |category: |Views: 66

tags: another

New in PostSharp 2.1: NuGet Package(www.sharpcrafters.com)

submitted by kingbee71kingbee71(511) 11 months, 25 days ago

PostSharp 2.1 offers NuGet packaging. NuGet is a very convenient way to install PostSharp. It provides a streamlined experience and does not require administrative privileges. But most importantly, it will allow third-party vendors and OSS projects to handle dependencies to PostSharp in a very easy way. If your project or product ships aspects, make it easy for developers: include PostSharp as a NuGet dependency. read more...

add a comment |category: |Views: 30

tags: another