InfoQ

InfoQ

News

My Bookmarks

Login or Register to enable bookmarks for unlimited time.

The content has been bookmarked!

There was an error bookmarking this content! Please retry.

CLR Add-In Model

Posted by Jonathan Allen on Feb 09, 2007

Sections
Development
Topics
.NET ,
.NET Framework
Tags
CLR Add-In Model

Currently .NET applications have the ability to host add-ins. Isolation and sand-boxing can even be accomplished via AppDomains. However there are some gapping holes in the use case. Microsoft's CLR Add-In Team intends to address these holes in VS 2007.

The CLR Add-In Team divides the issues into two sections. Version 1 problems affect applications the first time they try to add extensibility. Version 2 problems affect applications when their second version is released.

Version 1 problems include:

  • Activation
  • Discovery
  • Isolation
  • Lifetime Management
  • Loading/Unloading
  • Sandboxing

 Version 2 problems include:

  • Backwards compatibility: running V1 add-ins on V2 applications
  • Forwards compatibility: running V2 add-ins on V1 applications
  • Isolation changes: moving from AppDomain to Process isolation boundaries
  • Sharing: taking an add-in built for one application and running it in another

Jack Gudenkauf and Jesse Kaplan of MSDN Magazine covers some of these in their article, .NET Application Extensibility.

Add-ins are built against abstract classes defined by the host. The AddInStore is used to obtain information about available add-ins. Information about add-ins are returned as tokens containing the add-ins' Name, Version Number, Publisher, and Description.

Add-ins can be activated via their token. The activate is a one-line call that takes the security level the add-in will be run under and returns an object that implements the previously mentioned base class. The object actually runs in a separate AppDomain, which protects the rest of the application from failures within it.

In order to unload an add-in, its entire AppDomain must be unloaded. This can be as simple as calling ShutDown on the AddInController.

Like any new framework, the CLR Add-In Model needs a real application to put the design to the test. Jason He is running a series of articles on how to use the CLR Add-In Model to extend Paint.NET. Among other things, these articles go into some of the finer details of an add-in's life cycle.

No comments

Watch Thread Reply

Educational Content

Jesper Boeg on Priming Kanban

In this interview, Jesper Boeg, author of the new InfoQ book – Priming Kanban, discusses the keys to using Kanban effectively, and how to get started if you are currently using other approaches.

New-age Transactional Systems - Not Your Grandpa's OLTP

John Hugg discusses high volume transaction processing applications with high and low frequency profiles, and how VoltDB can be used for that purpose.

Cool Code

Kevlin Henney examines code samples to see what can be learned from them starting from the premise that one won’t write great code unless he knows how to read it.

Collaboration: At the Extremities of Extreme

Jason Ayers share the observations he made watching a team of developers collaborating in real time on the same code base, pushing XP, pair programming and continuous integration to their extremes.

Yesod Web Framework

Michael Snoyman presents Yesod, a web framework written in Haskell and containing a web server, templating, ORM, libraries (templating, gravatar, etc.).

Transactions without Transactions

Richard Kreuter and Kyle Banker on how to avoid classical RDBMS transactional systems by using compensation mechanisms, transactional messaging or transactional procedures.

Attila Szegedi on JVM and GC Performance Tuning at Twitter

Attila Szegedi talks about performance tuning Java and Scala programs at Twitter: how to approach GC problems, the importance of asynchronous I/O, when to use MySQL/Cassandra/Redis, and much more.

10 tips on how to prevent business value risk

One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.