introduction to csla.net keith elder microsoft mvp blog: quicken loans – every developer needs

Post on 18-Dec-2015

231 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Introduction to CSLA.Net

Keith ElderMicrosoft MVPBlog: http://keithelder.net/blog/Quicken Loans – http://www.quickenloans.com

Every developer needs an easy button.

AgendaAgenda

Why CSLA.Net?What is CSLA.Net?

Out of OrderLogical and Physical ArchitectureScalableComponent

Features as a frameworkCSLA PrinciplesCSLA In Action

Code generation for CSLAValidationBinding

WHY CSLA.NETWHY CSLA.NET

No code consistency

Every team has their own internal

standards

Where does validation go?

Where do authorization

rules go?

Low Reusability

Can’t share

tools or libraries

New Developers

How to teach them

Lack of code templates

Can’t contribute right away

Adding a developer to a project can hurt

timeline

Why CSLA?

WHAT IS CSLA.NETWHAT IS CSLA.NET

A business object framework.

C

S

L

A

Component

Scalable

Logical

Architecture

User Interface

Objects

Database

Logical And Physical Architecture

Three logical units that make up an application.

Objects

Database Interaction

Three Tiered Deployment

User Interface

Logical And Physical Architecture

Objects

DatabaseInteraction

Single Tier (Fat Client / Mobile)

App Server

Redeploy Application

Web Deployment

Database

Object

User Interface

Scalable

Objects

DatabaseInteraction

App Server

Objects

DatabaseInteraction

Objects

DatabaseInteraction

Objects

DatabaseInteraction

Database

s Cluster

Component

Database InteractionData Portal Methods•Insert•Update•Select•Delete

Properties•LoanAmount•State•FICO•LoanType•Etc…

Validation•LoanAmount Is Required•State Is Required•FICO is Required•LoanType Is Required

Business Rules•FICO > 620 for LoanType•LoanType in this State•LoanAmount > 100,000

Loan Business Object

Security•Viewable By Banker•Viewable By Director•Employee Loan requiresspecial token in operations

Methods and Delegates•DoesClientQualify()•LoanAmountChanged•CreditScoreChanged

Generating the Component

Behavior Driven

Development

Focus on Business

Requirements

Features of CSLA And CSLA Objects

Deployment

Build your application, decide how it is deployed later on

Binding

Automatically

supports data

binding for Winforms, Web, WPF

Other

Supports Workflow, WCF, and

Web Services

Internally

Mobile ObjectsBusiness logic and

data accessEasily

Generated

Unlimited Undos

Tracks broken business

rulesHas the object

changedBehavior Object-

Oriented Design

Nested Child Objects

Contact.Save();

Saves the contact and

all child objects like addresses,

notes, follow ups, loans,

etc.

CSLA PRINCIPLESCSLA PRINCIPLES

Base Classes

Editable Root

Editable Child

Editable, “switchable” (i.e., root or child)

Editable Root Collection

Editable Child Collection

Read-only

Read-only Collection

Command Object

Name Value List

Criteria Class

Holds information used to load the object

Nested within the business object

Can have multiple criteria classes for various purposes

Data Portal

Keeps track of where objects are instantiated,

as well as CRUD operations

Allows objects to move from client to app server

and back

Supports Remoting, Enterprise Services

(COM+), WCF and ASMX

CSLA Concepts

IDENTIFYING YOUR OBJECT TYPES

IDENTIFYING YOUR OBJECT TYPES

Loan Object Hierarchy

Root

Loan

Properties

FICO

LoanType

LoanAmount

Editable Child Objects

PrimaryBorrower

Editable Child Coll

Addresses

Editable Child

Address

CoBorrower

Editable Child Coll

Addresses

Editable Child

Address

Read Only

CreditReport

Red – CSLA TypeBlue – ClassGreen - Property

Let’s Go From Picture to Code

CSLA IN ACTIONDEMO

CSLA IN ACTIONDEMO

Code generation for CSLA

Validation

Binding

top related