Component-based Scalable Logical Architecture
   HOME

TheInfoList



OR:

CSLA .NET is a
software framework In computer programming, a software framework is a software abstraction that provides generic functionality which developers can extend with custom code to create applications. It establishes a standard foundation for building and deploying soft ...
created by Rockford Lhotka that provides a standard way to create robust
object oriented Object-oriented programming (OOP) is a programming paradigm based on the concept of '' objects''. Objects can contain data (called fields, attributes or properties) and have actions they can perform (called procedures or methods and impleme ...
programs using
business object A business object is an entity within a multi-tiered software application that works in conjunction with the data access and business logic layers to transport data. Business objects separate state from behaviour because they are communicated a ...
s. Business objects are objects that abstract business entities in an object oriented program. Some examples of business entities include sales orders, employees, or invoices. Although CSLA itself is free to download, the only documentation the creator provides are his books and videos, which are not free. CSLA (''Component-based Scalable Logical Architecture'') was originally targeted toward
Visual Basic Visual Basic is a name for a family of programming languages from Microsoft. It may refer to: * Visual Basic (.NET), the current version of Visual Basic launched in 2002 which runs on .NET * Visual Basic (classic), the original Visual Basic suppo ...
6 in the book ''Visual Basic 6.0 Business Objects'' by Lhotka. With the advent of
Microsoft .NET The Microsoft .NET strategy is a marketing plan that Microsoft followed in the early 2000s. Steve Ballmer described it as the company's "most ambitious undertaking since Internet Strategy Day in 1995". In support of this strategy, between 2000 an ...
, CSLA was completely rewritten from the ground up, with no code carried forward, and called CSLA .NET. This revision took advantage of
Web Services A web service (WS) is either: * a service offered by an electronic device to another electronic device, communicating with each other via the Internet, or * a server running on a computer device, listening for requests at a particular port over a n ...
and the object oriented languages that came with Microsoft .NET (in particular,
Visual Basic.NET Visual Basic (VB), originally called Visual Basic .NET (VB.NET), is a multi-paradigm, object-oriented programming language developed by Microsoft and implemented on .NET, Mono, and the .NET Framework. Microsoft launched VB.NET in 2002 as the ...
and C#). CSLA .NET was expounded in ''Expert C# Business Objects'' and ''Expert One-on-One Visual Basic .NET Business Objects'' , both written by Lhotka. Although CSLA and CSLA .NET were originally targeted toward
Microsoft Microsoft Corporation is an American multinational corporation and technology company, technology conglomerate headquartered in Redmond, Washington. Founded in 1975, the company became influential in the History of personal computers#The ear ...
programming languages A programming language is a system of notation for writing computer programs. Programming languages are described in terms of their syntax (form) and semantics (meaning), usually defined by a formal language. Languages usually provide features ...
, most of the framework can be applied to most object oriented languages. Current information about CSLA .NET is available through Lhotka's self-published ''Using CSLA 4'' ebook series.Using CSLA 4 ()


Features of CSLA


Smart data

A business object encapsulates all the data and behavior (business logic and rules) associated with the object it represents. For example, an OrderEdit object will contain the data and business rule implementations necessary for the application to correctly allow the user to edit order information.


Rules engine

The CSLA .NET framework provides a rules engine that supports validation rules, business rules, and authorization rules. These rules are attached to object instances or properties, and are automatically invoked by CSLA .NET when necessary. Validation rules may be implemented using the CSLA .NET rule engine, or through the use of the DataAnnotations feature of
Microsoft .NET The Microsoft .NET strategy is a marketing plan that Microsoft followed in the early 2000s. Steve Ballmer described it as the company's "most ambitious undertaking since Internet Strategy Day in 1995". In support of this strategy, between 2000 an ...
.


Object persistence

Data creation, retrieval, updates, and deletes (
CRUD In computer programming, create, read, update, and delete (CRUD) are the four basic operations (actions) of persistent storage. CRUD is also sometimes used to describe user interface conventions that facilitate viewing, searching, and changing info ...
) are performed by clearly defined methods of the business object associated with the data testing. Data access logic is clearly separated from business logic, typically using a repository pattern or other mainstream
object-oriented programming Object-oriented programming (OOP) is a programming paradigm based on the concept of '' objects''. Objects can contain data (called fields, attributes or properties) and have actions they can perform (called procedures or methods and impl ...
techniques.


Metastate maintenance

CSLA .NET manages the ''metastate'' about each business object. For example, each business object tracks information about when it is new (it represents data that hasn't been saved yet) and when it is dirty (it needs to be saved to the database either because it is new or because its member data has been changed since it was last loaded). Business objects can also be marked for deletion so they can later be deleted (for example when a user has pressed a button confirming his or her intention to delete the rows.)


''n''-Level undo

This feature makes it possible for an object or collection of objects to maintain a collection of states. This allows the object to easily revert to previous states. This can be useful when a user wants to undo previous edits multiple times in an application. The feature can also allow a user to redo multiple edits that were previously undone. This feature can provide rich functionality for desktop application and web applications. One note of caution would be to consider the overhead for high-transaction web-based applications. n-Level undo capability will require storing the previous state of an application generally accessed by reflection. This is common practice in desktop applications where changes must be "Applied". In web based designs, the added storage may pose unnecessary overhead as changes are generally submitted in batch and do not require the same level of "undo" capability.


Business rule tracking

Allows objects to maintain collections of "broken rule" objects. Broken rules will exist for an object until it is in a valid state, meaning it is ready to be persisted to the database. ''BrokenRule'' objects are usually associated with validation logic such as ensuring that no alphabetic characters are entered into a phone number field. For example, if an ''Account'' object has a ''PhoneNumber'' property, and that property is assigned a phone number with alphabetic characters, the ''Account'' object's ''IsValid'' property will become false (making it impossible to save to the database) and then a new ''BrokenRule'' object will be created and assigned to the Account's ''Broken Rules'' collection. The rule will disappear when the invalid phone number is corrected making the Account object capable of saving itself to the database.


''Extended features of CSLA''


Simple UI creation

Business objects created using CSLA .NET fully support data binding for all
Microsoft .NET The Microsoft .NET strategy is a marketing plan that Microsoft followed in the early 2000s. Steve Ballmer described it as the company's "most ambitious undertaking since Internet Strategy Day in 1995". In support of this strategy, between 2000 an ...
UI technologies, including
Windows Runtime Windows Runtime (WinRT) is a platform-agnostic component and application architecture first introduced in Windows 8 and Windows Server 2012 in 2012. It is implemented in C++ and officially supports development in C++ (via C++/WinRT, C++/CX ...
(
WinRT Windows Runtime (WinRT) is a platform-agnostic component and application architecture first introduced in Windows 8 and Windows Server 2012 in 2012. It is implemented in C++ and officially supports development in C++ (via C++/WinRT, C++/CX o ...
), WPF,
Web Forms ASP.NET is a server-side scripting, server-side web-application framework designed for web development to produce dynamic web pages. It was developed by Microsoft to allow programmers to build dynamic web sites, web application, applications a ...
,
ASP.NET MVC ASP.NET MVC is a web application framework developed by Microsoft that implements the model–view–controller (MVC) pattern. It is no longer in active development. It is open-source software, apart from the ASP.NET Web Forms component, which is ...
,
Windows Phone Windows Phone (WP) is a discontinued mobile operating system developed by Microsoft Mobile for smartphones as the replacement successor to Windows Mobile and Zune. Windows Phone featured a new user interface derived from the Metro design languag ...
,
Silverlight Microsoft Silverlight is a discontinued application framework designed for writing and running rich internet applications, similar to Adobe's runtime, Adobe Flash. While early versions of Silverlight focused on streaming media, later version ...
, and
Windows Forms Windows Forms, also known as WinForms, is a free, open-source graphical user interface (GUI) class library for building Windows desktop applications, included as a part of Microsoft .NET, .NET Framework or Mono, providing a platform to write c ...
. Data-bound controls like DataGrids and ListBoxes can be bound to business objects instead of more generalized database objects like
ADO.NET ADO.NET is a data access technology from the Microsoft .NET Framework that provides communication between relational and non-relational systems through a common set of components. ADO.NET is a set of computer software components that programmers ...
DataSets and DataTables.


Distributed data access

The CSLA .NET framework implements a concept called mobile objects or mobile agents to allow objects to move across network boundaries using WCF,
Web Services A web service (WS) is either: * a service offered by an electronic device to another electronic device, communicating with each other via the Internet, or * a server running on a computer device, listening for requests at a particular port over a n ...
, or other technologies. As a result, the data access enjoys
location transparency In computer networks, location transparency is the use of names to identify network resources, rather than their actual location. For example, files are accessed by a unique file name, but the actual data is stored in physical sectors scattered aro ...
, meaning that the logic may run on the client workstation or server depending on the application's configuration. It can also be configured to use manual
database transaction A database transaction symbolizes a unit of work, performed within a database management system (or similar system) against a database, that is treated in a coherent and reliable way independent of other transactions. A transaction generally rep ...
s or distributed
two-phase commit Two-phase may refer to: * Two-phase electric power * Two-phase commit protocol * Two-phase flow * Two-phase locking * Binary phase, chemical compounds composed of two elements {{Disambig ...
transactions. Data access logic is cleanly separated from business logic, and can be implemented using any data access technology available on the
Microsoft .NET The Microsoft .NET strategy is a marketing plan that Microsoft followed in the early 2000s. Steve Ballmer described it as the company's "most ambitious undertaking since Internet Strategy Day in 1995". In support of this strategy, between 2000 an ...
platform. Examples include
ADO.NET Entity Framework Entity Framework (EF) is an open source object–relational mapping (ORM) framework for ADO.NET. It was originally shipped as an integral part of .NET Framework, however starting with Entity Framework version 6.0 it has been delivered separatel ...
, raw
ADO.NET ADO.NET is a data access technology from the Microsoft .NET Framework that provides communication between relational and non-relational systems through a common set of components. ADO.NET is a set of computer software components that programmers ...
,
nHibernate NHibernate is a port of the Hibernate object–relational mapping (ORM) framework for the Microsoft .NET platform. It provides a framework for mapping an object-oriented domain model to a traditional relational database. It is used to map an o ...
, etc.


Web Services support

Business logic created with the CSLA .NET framework can easily be exposed as a web service to remote consumers. This can be done using server-side
Microsoft .NET The Microsoft .NET strategy is a marketing plan that Microsoft followed in the early 2000s. Steve Ballmer described it as the company's "most ambitious undertaking since Internet Strategy Day in 1995". In support of this strategy, between 2000 an ...
technologies such as
Web API A web API is an application programming interface (API) for either a web server or a web browser. As a web development concept, it can be related to a web application's client side (including any web frameworks being used). A server-side web AP ...
, WCF, and asmx web services.


References

* Training *
CSLA.NET Training
* Books *
Using CSLA 4 ebook series
** Expert C# 2008 Business Objects ** Expert VB 2008 Business Objects {{ISBN, 978-1-4302-1638-4 ** Using CSLA .NET 3.0 ** CSLA .NET Version 2.1 Handbook ** Expert C# 2005 Business Objects ** Expert VB 2005 Business Objects ** Expert C# Business Objects ** Expert VB Business Objects ** Visual Basic 6 Distributed Objects ** Visual Basic 6 Business Objects ** Visual Basic 5 Business Objects * Web sites *
CSLA .NET Training
*
CSLA .NET home page
*
CSLA .NET on GitHub
*
CSLA .NET community forum


External links


Rockford Lhotka's website
Application programming interfaces Component-based software engineering C Sharp libraries