Featured in
Process & Practices

In-App Subscriptions Made Easy

There are various types of subscriptions: recurring, non-recurring, free-trial periods, various billing cycles and any possible billing variation one can imagine. But with lack of information online, you might discover that mobile subscriptions behave differently from what you expected. This article will make your life somewhat easier when addressing an in-app subscriptions implementation.

Featured in
Enterprise Architecture

EIP Designer: Bridging the Gap Between EA and Development

This article presents the EIP Designer project, an Eclipse-based tool for introducing integration patterns into an EA design, providing fluidity and continuity while filling the gap existing between EA practices and concrete software development.

.NET 4 Cancellation Framework

.NET 4 will have new types to support building cancellation-aware applications and libraries. The new CancellationToken, CancellationTokenSource, and cancellation exception types provide a cooperative cancellation framework.

the motivating principles that the new types were designed to support:

any unit of work is commenced, it should have a consistent means to support early termination in response to a cancellation request.

If some unit of work controls various other moving pieces, it should be able to conveniently chain cancellation requests to them.

When infrastructure makes calls back to potentially long-running user code, it should be possible for the user code to observe and respond to cancellation requests in a cooperative fashion.

Cancellation should be an obvious part of an API with clean and consistent semantics.

Cancellation should not be forceful but instead cooperative.

The framework is built upon two new types:

CancellationToken

a struct that represents a ‘potential request for cancellation’. This struct is used as an argument to allow methods to poll on it or register a callback to be fired when cancellation is requested.

CancellationTokenSource

a class that provides the mechanism for initiating a cancellation request. It also provides an association to the related token. This design allows separation of the the two primary cancellation operations: initiating a cancellation request & observing and responding to cancellation. Specifically, methods that accept only a CancellationToken can observe a cancellation request but cannot initiate one.

These new .NET 4 cancellation types provide a framework for building systems that have robust and consistent cancellation behaviors. This will specifically assist with GUIs, applications, and libraries that manage long running or blocking operations. The long-term goal is to reduce the variation and inconsistencies in the current offering of 3rd-party cancellation solutions. These new types will also offer a uniform contract to interoperate with Parallel Extensions.