dnp.Framework code released!

May 21, 2009 22:25 by garrymc

In an effort to start getting more of the code I’ve been working on out in the public domain, I’ve finally released all the code for the dnp.Framework on CodePlex. While its not all complete, most of the code is quite stable and can be used now!

Some of the major components that are included in the framework include:

  • Database Explorer API: An object oriented database schema API which is ideal for anyone wanting to do code generation. Its based on the provider pattern, so while it currently only supports SQL Server 2005+ its fairly easy to create a new provider for any system. This is stable enough for production use and has an extensive set of unit tests.
  • Data Provider: This is a database agnostic API which is fairly similar to the one in the enterprise library except it doesn’t support datasets and the like. Its also has little overhead. This was designed before the Enterprise Library had a decent model, and it has also been used on mobile devices with the compact framework.
  • DomainModeller: An abstract domain model view of a database schema (extends Database Explorer API). This API is most useful to creating scripts for code generation, where you can concentrate on domain concepts such as base classes, derived classes, namespaces and relationships etc, rather than database concepts. Using this API for code generation can significantly reduce the amount of code typically required.
  • ServiceModel: This project is still under development, but aims to provide the first ‘Model’ that extends the Domain Modeller to define a Service based Application framework. The ServiceModel acts as the abstract API for the final code generation scripts which are currently written using CodeSmith. The scripts currently have good support for the data access layer (repository), service layer (business logic) and entities (using design discussed here).

There are other components that are less substantial but provide useful features:

  • Configuration: classes to allow custom sections in config files.
  • IO: classes to make getting info from resource files easier.
  • Collections: classes that support multi-keyed collections. This is useful when you want to key on a natural or business key which is made up of more than one field.
  • Reflection: classes to help with serialization
  • Scripting: classes that help with naming such as converting names to plural or singular versions, casing such as pascal, camel and proper. There’s also an expression evaluator that allows evaluating an expression against an object. This is used heavily in the Domain Modeller and ServiceModel config files.
  • Security: CookieProtection, MachineKey encoding
  • Web: SafeLocalStorage, thread wide TimeZone conversions, Web log (IIS) Linq provider

This framework has taken some time to get this far and while not complete does provide a number of features that are useful today. Over the next few months I’ll blog about some of the features mentioned above to provide a better understanding of how to use them. For now the best way to get a feel for how classes are used is to look at the unit tests for the class. Most of the features have tests which give a good idea of how its used.

If you’d like to have a particular feature explained in more depth, leave a comment here otherwise I’ll pick the ones I like :)

Oh and you can find all the code here!

kick it on
Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

Currently rated 2.7 by 10 people

  • Currently 2.7/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5