LPC: an action, caching & brokering framework

, 1,018 words


The LothianProductionsCommon (LPC) library is a simple and easy-to-master framework for solving common enterprise data-access issues that crop up when scaling .NET and J2EE applications.

The project has contributors across the world and is in use in a variety of .NET and Mono production environments. It has been used in both NASDAQ companies and small non-technical organisations.

It offers many valuable facilities, including functionality in these key areas:

Database portability and abstractionThe ConnectionProvider provides a great many wrappers for core data retrieval calls, as well as providing a database independent means for instantiating connections. It also provides a number of static SQL and command manipulation functions. LothianProductions.Data
Auto numberingThe Autonumber class exposes an interface for incrementing a custom numeric index field in a given table.LothianProductions.Data
Tiered abstraction layersThe Factory and related Broker classes provide for easy abstraction of an application across multiple tiers.LothianProductions.Data
String, date, numeric manipulationThe StringHelper, DateHelper and MathHelper classes provide various helper functionsLothianProductions.Util
Caching and poolingThe Cache and RelationshipCache classes provide for TTL-enabled detached caching of objects and relationship.LothianProductions.Util.Cache
DaemonThe DaemonScheduler and EagerCacheDaemon implementation provide for the execution of regular, scheduled tasks and pre-emptive caching.LothianProductions.Util.Daemon
ConfigurationThe AppSettingsHelper provides a mechanism for easily obtaining complex configuration data.LothianProductions.Util.Settings
Action frameworkLothianProductions.Actions

Currently only the C# .NET version of the LPC is supported.

Scope of this document

This document describes and explains the LothianProductionsCommon framework.

Table of contents

Glossary of terms

Technical terminology

LPC Abbreviation for the LothianProductionsCommon project.
Façade A façade is an engineering pattern similar to an adapter. It allows components to be transparently switched, for instance to allow a service to use multiple data sources.
Model 1 Simple "flat" template modelling. Does not afford distinct roles to components which direct, provide or transform the data being used.
MVC Stands for model view controller and is a factoring pattern that allows an application great flexibility. The model represents the application.s underlying data model, the view represents the applications views on that data and the controller represents the business logic that takes a user between different views of data and performs different operations on it.

Refactoring an MVC application is often exponentially cheaper than a non-MVC application. (See also PAC.)
Model 2 An implementation of MVC factoring for templates.
webapp "Web application".
UML Unified modelling language, the standard visual communication language for software engineers.
Domain analysis Modelling and understanding the domain for a given solution. The domain is the complete area for which the solution is being provided.
DAL Data access layer. The part of an application that is specifically and solely focussed on reading and persisting data.
Component diagram A diagram that is lower-level than a dataflow diagram, providing visibility to software or hardware components and implementation details.
Web Service A Web Service is an XML and HTTP based interface which provides a simple consistent mechanism for working with data.
Agile Agile development is a recent software engineering methodology. It provides for safer development than many of the older methodologies, and can deliver business value earlier.

Extreme Programming is one of the main agile methodologies.


What does a typical request lifecycle look like when using the action framework?

This diagram shows a typical request's lifecycle when running on the .NET platform.

Is there a flow-chart summarising the cache decision flow?

See here.

Why does the LPC differentiate between domain and relational data?

Differentiation between domain and relational data

See here.


2.5 (May 2008)

  • Lite DML autogeneration framework for improved ORM on Cacheable objects
  • Query interception and analysis for all DML statements; integrated reporting
  • New configuration mechanism for brokers, factories & caching; much simpler to manage
  • Rewritten HttpAction framework with regexp-based URL-space support
  • Primitive HTTP proxy server implementation
  • Enhanced custom handler support for configuration relocated over HTTP or into assemblies or resources

2.4 (October 2007)

  • Native HTTP/1.0 client & server implementation, including gzip & easy upload tools
  • Reusable licensing & activation framework
  • Audio, video & graphic manipulation libraries
  • Cluster support & load-balance mechanisms: remote cache manipulation
  • Enhanced monitoring & reporting tools, for stand-alone & cluster monitoring
  • More CMS functionality: address generator module for rendering SEO-friendly URLs
  • Some meta-search framework tools

2.3 (April 2007)

  • Integrated connection pooling (beneficial for non-pooling OleDb or Odbc implementations)
  • Improved caching of relocated configuration files
  • Re-write of templating code & introduction of conditional directive parser tags

2.2 (November 2006)

  • Combinatorial relationship functions
  • Seamless support for external configuration files in common .Config format
  • Robust error-handling HttpModule with email notification
  • Introduction of "{criteria}" & "{dependancy}" placeholder in .config
  • New ActionHttpHandlers supporting sessions: RoSessionActionHttpHandler, RwSessionActionHttpHandler
  • Deprecation of static datatype manipulation calls in ConnectionProvider; moved to schemes
  • Configurable ActionHttpHandler action types

2.1 (27th March 2006)

  • Introduction of new connection schemes
  • Support for native .NET 2.0 connection declaration

2.0 (24th November 2005)

  • .NET 2.0 support
  • .config properties refactored down into top-level "lpc/" configuration section

1.2 (26th April 2005)

  • Oracle sequencing support
  • Start of XmlHelper and broader XML support
  • Support for named datasources
  • Factored out Oracle and MySql specific code
  • Visual FoxPro support patches
  • Greater Web Service support
  • Cache optimisations

1.1 (29th October 2004)

  • Tracing and logging optimisations
  • Search framework improvements: IsNull and Like, ordering bug-fixes
  • Visual FoxPro support

1.0 (23rd February 2004)

  • Working domain object and relationship caching
  • Passes all NUnit tests

pre 1.0 (mid 2003)

  • 2003: Migration from J2EE.
  • 2002: Ported version becomes the backbone of sites for major .com. Optimisation takes page costs to sub-10ms on low-end SPARC devices.
  • 2001: The system is first conceived and implemented in Java. Prototype successfully employed by major .com to launch 300,000 page high-performance webapp.


  • Aidan Fitzpatrick
  • Andrew Dancy
  • Kevin Fisher
  • Magnus Solvåg
  • Trond Førde
  • David Santoro
  • Ken Fassone