Intro To CSLA.Net Framework

Download Report

Transcript Intro To CSLA.Net Framework

Introduction to CSLA.Net
Every developer needs an easy button.
Keith Elder
Microsoft MVP
Blog: http://keithelder.net/blog/
Quicken Loans –
http://www.quickenloans.com
Agenda
Why CSLA.Net?
What is CSLA.Net?
Out of Order
Logical and Physical Architecture
Scalable
Component
Features as a framework
CSLA Principles
CSLA In Action
Code generation for CSLA
Validation
Binding
WHY CSLA.NET
Why CSLA?
No code
consistency
Low
Reusability
How to teach them
Every team has their
own internal standards
Where does validation
go?
Where do
authorization rules go?
New
Developers
Can’t share
tools or
libraries
Lack of code templates
Can’t contribute right
away
Adding a developer to
a project can hurt
timeline
WHAT IS CSLA.NET
A business object
framework.
C
Component
S
Scalable
L
Logical
A
Architecture
Logical And Physical
Architecture
User Interface
Objects
Objects
Database
Database
Interaction
Three logical
units that
make up an
application.
Logical And Physical
Architecture
UserObject
Interface
Single
Three
Redeploy
TierTiered
(FatApplication
Client
Deployment
/ Mobile)
Web Deploym
Objects
Database
Database
Interaction
App Server
Scalable
User Interface
Objects
Objects
Database
Interaction
Database
Interaction
Objects
Objects
Database
Interaction
Database
Interaction
App Server s
Database Cluster
Generating
Component
the Component
Properties
•LoanAmount
•State
•FICO
•LoanType
•Etc…
Database Interaction
Data Portal Methods
•Insert
•Update
•Select
•Delete
Security
•Viewable By Banker
•Viewable By Director
•Employee Loan requires
special token in operations
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
Methods and Delegates
•DoesClientQualify()
•LoanAmountChanged
•CreditScoreChanged
Behavior
Focus on
Business
Driven
Requirements
Development
Loan Business Object
Features of CSLA And CSLA
Objects
Deployment
Binding
Other
Internally
Nested Child
Objects
Mobile Objects
Business logic
and data access
Build your
application,
decide how it
is deployed
later on
Automatically
supports data
binding for
Winforms,
Web, WPF
Supports
Workflow,
WCF, and
Web Services
Easily Generated
Unlimited Undos
Tracks broken
business rules
Has the object
changed
Behavior ObjectOriented Design
Contact.Save();
Saves the
contact and all
child objects
like addresses,
notes, follow
ups, loans, etc.
CSLA PRINCIPLES
CSLA Concepts
Base
Classes
Criteria
Class
Data
Portal
Holds information used to
load the object
Keeps track of where objects
are instantiated, as well as
CRUD operations
Nested within the business
object
Allows objects to move from
client to app server and back
Can have multiple criteria
classes for various purposes
Supports Remoting,
Enterprise Services (COM+),
WCF and ASMX
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
IDENTIFYING YOUR OBJECT
TYPES
Loan Object Hierarchy
Red – CSLA Type
Blue – Class
Green - Property
FICO
Properties
LoanType
LoanAmount
Root
Loan
PrimaryBorrower
Editable Child Coll
Addresses
Editable Child
Address
CoBorrower
Editable Child Coll
Addresses
Editable Child
Address
Editable Child
Objects
Read Only
CreditReport
Let’s Go From Picture to Code
CSLA IN ACTION
DEMO
Code generation for CSLA
Validation
Binding