Component-based Scalable Logical Architecture

Component-based Scalable Logical Architecture

Component-based Scalable Logical Architecture (CSLA) is a software framework created by Rockford Lhotka that provides a standard way to create robust object oriented programs using business objects. 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, which are not free.

CSLA was originally targeted toward Visual Basic 6 in the book Visual Basic 6.0 Business Objects by Lhotka ISBN 1-86100-107-X. With the advent of Microsoft .NET, CSLA was completely rewritten from the ground up, with no code carried forward, and called CSLA.NET. This revision took advantage of Web Services and the object oriented languages that came with Microsoft .NET (in particular, Visual Basic.NET and C#).

CSLA.NET was expounded in Expert C# Business Objects ISBN 1-59059-344-8 and Expert One-on-One Visual Basic .NET Business Objects ISBN 1-59059-145-3, both written by Lhotka. Although CSLA and CSLA.NET were originally targeted toward Microsoft programming languages, most of the framework can be applied to most object oriented languages.

Contents

Features of CSLA

Smart data

A business object encapsulates all the data and behavior (including persistence logic) associated with the object it represents. For example, an order object will be the only part of the program to load an order, obtain or assign the order's member data (order numbers, etc...), save the order, and so on.

Typed Collections

The framework defines a standard way to create collection objects which represent a collection of objects. This allows an object model to map well to a relational database's data model. For example, an Account table could map to an Accounts (observe the pluralization) collection object (in reality the object model will differ from the relational model, it is therefore necessary to employ Object-Relational Mapping to resolve the differences). In this case each row in the Account table would map to an Account business object which is contained in the Accounts collection object. This makes it possible to define methods for the collection object that will propagate to its constituent objects. For example, to save all the Account objects in an Accounts collection, one would type:
myAccountsCollection.Save();
The Save() method will call the Save() method on each of its constituent Account objects.

// Inside the Accounts class
public void Save(){
    // _accounts will normally be some type of array variable with class scope
    // that holds all of the Account objects represented in this collection.
    foreach (Account acct in _accounts){
        acct.Save(); // The actual Account object does the work of saving itself to the database
    }
}

This method of propagating changes to a collection's constituent object can be used for other common methods and property assignments as well(myAccountsCollection.Load(); myAccountsCollection.Active = false;). Business objects can also contain other collection objects, in effect creating a relationship analogous to a parent child relationship between two tables. For example, the Account object mentioned above can contain an Orders collection object which in turn contains Order objects. In this case, the above call to Save() on the Accounts collection object could be written to save all of the Account objects as well as all of the orders associated with each of the accounts.

Object persistence

Data creation, retrieval, updates, and deletes (CRUD) are performed by clearly defined methods of the business object associated with the data testing.

Persistence state maintenance

CSLA defines a standard way of allowing a business object to maintain information about its "persistence state". In other words, an object knows 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 back 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.

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

Using Windows Forms or Web Forms, data-bound controls like DataGrids and ListBoxes can be bound to business objects instead of more generalized database objects like ADO.NET DataSets and DataTables.

Distributed data access

Using Web Services, an object can perform its data access on the client machine or a server. It can also be configured to use manual database transactions or distributed two-phase commit transactions.

Web Services support

Business logic created with the CSLA.NET framework can easily be exposed as a web services to remote consumers. .

References

  • Books
    • Expert C# 2008 Business Objects ISBN 978-1430210191
    • Expert VB 2008 Business Objects
    • 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

External links

CSLA Training


Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • Multimodal Architecture and Interfaces — is an open standard developed by the World Wide Consortium since 2005. Currently it is a working draft ( Working Draft ) of the W3C . The document is a technical report specifying a multimodal system architecture and its generic interfaces to… …   Wikipedia

  • Сравнение каркасов веб-приложений — Это сравнительная таблица фреймворков веб приложений. Содержание 1 Фреймворки 1.1 ASP.NET 1.2 C++ 1.3 ColdFusion Markup Language (CFML) …   Википедия

  • Software framework — A software framework, in computer programming, is an abstraction in which common code providing generic functionality can be selectively overridden or specialized by user code providing specific functionality.Frameworks are similar to software… …   Wikipedia

  • Rockford Lhotka — A major contribution of Lhotka s is his Component based Scalable Logical Architecture (CSLA) and its Microsoft .NET equivalent CSLA.NET. CSLA is an object oriented software framework that provides a standard way to create robust object oriented… …   Wikipedia

  • CSLA — may refer to: California School Library Association Component based Scalable Logical Architecture Community Sports Leader Award Canadian Society of Landscape Architects / L Association des Architectes Paysagistes du Canada Confederación Sindical… …   Wikipedia

  • Btrieve — In computing, Btrieve is a transactional database product based on Indexed Sequential Access Method (ISAM), which is a way of storing data for fast retrieval. There have been several versions of the product for DOS, Linux, older versions of… …   Wikipedia

  • List of computing and IT abbreviations — This is a list of computing and IT acronyms and abbreviations. Contents: 0–9 A B C D E F G H I J K L M N O P Q R S T U V W X Y …   Wikipedia

  • Parallel computing — Programming paradigms Agent oriented Automata based Component based Flow based Pipelined Concatenative Concurrent computing …   Wikipedia

  • Abkürzungen/Computer — Dies ist eine Liste technischer Abkürzungen, die im IT Bereich verwendet werden. A [nach oben] AA Antialiasing AAA authentication, authorization and accounting, siehe Triple A System AAC Advanced Audio Coding AACS …   Deutsch Wikipedia

  • Liste der Abkürzungen (Computer) — Dies ist eine Liste technischer Abkürzungen, die im IT Bereich verwendet werden. A [nach oben] AA Antialiasing AAA authentication, authorization and accounting, siehe Triple A System AAC Advanced Audio Coding AACS …   Deutsch Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”