RealTime IT News

SpringSource's Update to .NET Adds Key Java Features

Developers may now be able to build .NET Framework applications using concepts previously available only on Java, thanks to the release of SpringSource's Spring.Net.

Spring is about "making it easy to swap implementations in and out," Spring.Net Project Lead Mark Pollack told InternetNews.com. "We're not tied to languages but to programming ideas. Spring is bringing ideas developed in Java to .NET."

SpringSource, formerly known as Interface21, previously released the Spring Framework programming model for Java.

The two major Java features of the Spring Framework now available for .NET are dependency injection and an aspect-oriented programming framework, complementing the object-oriented programming (OOP) used in .NET.

Dependency injection is an application configuration concept that makes it easier to swap services. In traditional OOP, when Object A asks for Object B, that hard-codes the objects' connection and dependency. If Object B is replaced or removed, all of the code needs to be changed.

Dependency injection, on the other hand, doesn't rely on Object A asking for Object B.

"Normally, things are hard-coded, making it difficult to test, whereas this approach -- of handing an object what it needs, instead of an object asking for it -- promotes plugability," said Pollack.

The aspect-oriented programming framework allows for performing functions when a method gets called. When the method is called, a predefined behavior or action is initiated.

That way, when the program is doing one task, a second step or process is also invoked to back up, support or operate in tandem with the first process.

This allows for features like caching or exception handling, and is more efficient than starting and stopping a process or having to keep repeating code to perform checks for conditions, Pollack said.

Java has this feature in Enterprise JavaBeans, but SpringSource's Spring.Net now makes it available for the .NET programmer.

Other key features of Spring.Net 1.1 include ASP.NET AJAX (Asynchronous JavaScript and XML) integration and portable service abstraction, to export plain .NET objects via .NET Remoting and other technologies.

It also includes an Aspect Library of predefined, easy-to-use aspects for transaction management, logging, performance monitoring, caching, method retry, and exception handling. Additionally, the release provides Declarative Transaction Management via XML configuration and attributes and ADO.NET Data Access Framework, which simplifies the use of ADO.NET.