Introduction to CSLA


Chris Dufour
Software Architect, Compuware
chris.dufour@wigets.net
Introduction to CSLA

Objective
Develop an application design architecture that will allow
us to develop leading edge applications utilizing a
composite design approach.

Our design needs to provide us with the following
features
 •   Performance
 •   Scalability
 •   Security
 •   Maintainability
 •   Extensibility
 •   Testability
Introduction to CSLA

Challenges of Application Development
Applications are costly to develop and maintain
 •   Lack of consistency at an architectural level
 •   Too much focus on technology, not enough on business
Applications become rigid and hard to change
 •   Lack of formalization around building a business layer
 •   Too many “one-off” solutions to problems
Underlying technology is in constant change
 •   Technology is in turmoil
      – UI technologies change continually
      – Database access techniques change regularly
Introduction to CSLA

What is CSLA .NET?
•A development framework focused on
managing and implementing business logic
•Enables creation of business objects with
automatic support for advanced features
•Supports 1,2 and n-tier deployment models
Provide flexible data management
Introduction to CSLA

CSLA .NET Features
•Data binding
   •Silverlight, WPF, Windows, Web
•Standardized business logic
   •Validation rules
   •Authorization rules
•Powerful undo capabilities
•Abstract data persistence
   •ADO.NET, EF,LINQ, Others
•Mobile objects
   •Deployment flexibility
Introduction to CSLA

Distributed Architecture
Introduction to CSLA

Responsibilities
Layer               Roles
Interface           Renders display and collects user input.
Interface Control   Acts as an intermediary between the user and the business
                    logic, taking user input and providing it to the business
                    logic, then returning results to the user. (ASPX Server Side
                    Code)
Introduction to CSLA

Responsibilities
Layer               Roles
Interface           Renders display and collects user input.
Interface Control   Acts as an intermediary between the user and the business
                    logic, taking user input and providing it to the business
                    logic, then returning results to the user. (ASPX Server Side
                    Code)
Business Logic      Provides all business rules, validation, manipulation,
                    processing, and security for the application.
Introduction to CSLA

Responsibilities
Layer               Roles
Interface           Renders display and collects user input.
Interface Control   Acts as an intermediary between the user and the business
                    logic, taking user input and providing it to the business
                    logic, then returning results to the user. (ASPX Server Side
                    Code)
Business Logic      Provides all business rules, validation, manipulation,
                    processing, and security for the application.
Data Access         Acts as an intermediary between the business logic and
                    data management. Also encapsulates and contains all
                    knowledge of data access technologies (such as ADO
                    .NET, Enterprise Library etc), databases, and data
                    structures.
Introduction to CSLA

Responsibilities
Layer               Roles
Interface           Renders display and collects user input.
Interface Control   Acts as an intermediary between the user and the business
                    logic, taking user input and providing it to the business
                    logic, then returning results to the user. (ASPX Server Side
                    Code)
Business Logic      Provides all business rules, validation, manipulation,
                    processing, and security for the application.
Data Access         Acts as an intermediary between the business logic and
                    data management. Also encapsulates and contains all
                    knowledge of data access technologies (such as ADO
                    .NET, Enterprise Library etc), databases, and data
                    structures.
Data Storage &      Physically creates, retrieves, updates, and deletes data in
Management          a persistent data store. (SQL Server)
Introduction to CSLA

N-tier independent
•1-, 2- 0r 3-tier deployments support
•Change deployment models without changing code
Introduction to CSLA

Standalone Application
Introduction to CSLA

2-Tier Client/Server
Introduction to CSLA

3-Tier Client/Server
Presentation title

Object Stereotypes
• Editable object
      Single
      List
      Root
      Parent
      Child
• Dynamic list
    List of editable root objects
• Read-only object
    Single
    List
Presentation title

Object Stereotypes
• Name/value list
    Read-only list of name/value objects
• Command
    Execute code on client and server
• Criteria
    Parameter object to create/fetch
• Object factory
      Create
      Fetch
      Update
      Delete
      Execute
Introduction to CSLA

Demo



       Lets see some code!
Introduction to CSLA
CSLA .NET Reduces Application
Development and Maintenance Costs
•CSLA defines specific application layers
 •   Every type of code has a “home” in the architecture
•CSLA codifies a formal architecture
 •   Framework makes it easy to do the right thing
 •   Developers follow the path of least resistance
•CSLA enables object-orientation
 •   OO design results in code that is more…
             Organized, readable, maintainable, flexible
•CSLA lets developers focus on your business problems,
not the technology
Introduction to CSLA

CSLA Increases Application Agility
•Formal business layer enables change
 • Change the UI, Change the database, change
   deployment
 • Use iterative, agile techniques to refactor objects over
   time
•Object-oriented design aligns with business
 • Use case driven design
 • Common terminology between business and
   developers
•Object-oriented business layer enables change
 • Minimize dependencies and coupling
 • Normalization of behavior
Introduction to CSLA

CSLA Minimizes Impact of Change
A CSLA .NET business layer is

•UI independent
 •   Web Forms, AJAX, MVC, Silverlight, WCF services,
     Workflow, Windows Forms, etc
•Database independent
 • Formal structure for invoking all CRUD operations
 • Can use any data access layer or ORM tool
     – ADO .NET, Enterprise Library, Entity Framework, NHibernate, etc

•N-tier independent
 • 1-, 2- 0r 3-tier deployments support
 • Change deployment models without changing code
Thank You


Chris Dufour
Software Architect, Compuware
chris.dufour@wigets.net

Introduction to CSLA

  • 1.
    Introduction to CSLA ChrisDufour Software Architect, Compuware chris.dufour@wigets.net
  • 2.
    Introduction to CSLA Objective Developan application design architecture that will allow us to develop leading edge applications utilizing a composite design approach. Our design needs to provide us with the following features • Performance • Scalability • Security • Maintainability • Extensibility • Testability
  • 3.
    Introduction to CSLA Challengesof Application Development Applications are costly to develop and maintain • Lack of consistency at an architectural level • Too much focus on technology, not enough on business Applications become rigid and hard to change • Lack of formalization around building a business layer • Too many “one-off” solutions to problems Underlying technology is in constant change • Technology is in turmoil – UI technologies change continually – Database access techniques change regularly
  • 4.
    Introduction to CSLA Whatis CSLA .NET? •A development framework focused on managing and implementing business logic •Enables creation of business objects with automatic support for advanced features •Supports 1,2 and n-tier deployment models Provide flexible data management
  • 5.
    Introduction to CSLA CSLA.NET Features •Data binding •Silverlight, WPF, Windows, Web •Standardized business logic •Validation rules •Authorization rules •Powerful undo capabilities •Abstract data persistence •ADO.NET, EF,LINQ, Others •Mobile objects •Deployment flexibility
  • 6.
  • 7.
    Introduction to CSLA Responsibilities Layer Roles Interface Renders display and collects user input. Interface Control Acts as an intermediary between the user and the business logic, taking user input and providing it to the business logic, then returning results to the user. (ASPX Server Side Code)
  • 8.
    Introduction to CSLA Responsibilities Layer Roles Interface Renders display and collects user input. Interface Control Acts as an intermediary between the user and the business logic, taking user input and providing it to the business logic, then returning results to the user. (ASPX Server Side Code) Business Logic Provides all business rules, validation, manipulation, processing, and security for the application.
  • 9.
    Introduction to CSLA Responsibilities Layer Roles Interface Renders display and collects user input. Interface Control Acts as an intermediary between the user and the business logic, taking user input and providing it to the business logic, then returning results to the user. (ASPX Server Side Code) Business Logic Provides all business rules, validation, manipulation, processing, and security for the application. Data Access Acts as an intermediary between the business logic and data management. Also encapsulates and contains all knowledge of data access technologies (such as ADO .NET, Enterprise Library etc), databases, and data structures.
  • 10.
    Introduction to CSLA Responsibilities Layer Roles Interface Renders display and collects user input. Interface Control Acts as an intermediary between the user and the business logic, taking user input and providing it to the business logic, then returning results to the user. (ASPX Server Side Code) Business Logic Provides all business rules, validation, manipulation, processing, and security for the application. Data Access Acts as an intermediary between the business logic and data management. Also encapsulates and contains all knowledge of data access technologies (such as ADO .NET, Enterprise Library etc), databases, and data structures. Data Storage & Physically creates, retrieves, updates, and deletes data in Management a persistent data store. (SQL Server)
  • 11.
    Introduction to CSLA N-tierindependent •1-, 2- 0r 3-tier deployments support •Change deployment models without changing code
  • 12.
  • 13.
  • 14.
  • 15.
    Presentation title Object Stereotypes •Editable object  Single  List  Root  Parent  Child • Dynamic list  List of editable root objects • Read-only object  Single  List
  • 16.
    Presentation title Object Stereotypes •Name/value list  Read-only list of name/value objects • Command  Execute code on client and server • Criteria  Parameter object to create/fetch • Object factory  Create  Fetch  Update  Delete  Execute
  • 17.
    Introduction to CSLA Demo Lets see some code!
  • 18.
    Introduction to CSLA CSLA.NET Reduces Application Development and Maintenance Costs •CSLA defines specific application layers • Every type of code has a “home” in the architecture •CSLA codifies a formal architecture • Framework makes it easy to do the right thing • Developers follow the path of least resistance •CSLA enables object-orientation • OO design results in code that is more… Organized, readable, maintainable, flexible •CSLA lets developers focus on your business problems, not the technology
  • 19.
    Introduction to CSLA CSLAIncreases Application Agility •Formal business layer enables change • Change the UI, Change the database, change deployment • Use iterative, agile techniques to refactor objects over time •Object-oriented design aligns with business • Use case driven design • Common terminology between business and developers •Object-oriented business layer enables change • Minimize dependencies and coupling • Normalization of behavior
  • 20.
    Introduction to CSLA CSLAMinimizes Impact of Change A CSLA .NET business layer is •UI independent • Web Forms, AJAX, MVC, Silverlight, WCF services, Workflow, Windows Forms, etc •Database independent • Formal structure for invoking all CRUD operations • Can use any data access layer or ORM tool – ADO .NET, Enterprise Library, Entity Framework, NHibernate, etc •N-tier independent • 1-, 2- 0r 3-tier deployments support • Change deployment models without changing code
  • 21.
    Thank You Chris Dufour SoftwareArchitect, Compuware chris.dufour@wigets.net