Solo vs. Magenic Team

Download Report

Transcript Solo vs. Magenic Team

CSLA
• Presenter Sergey Barskiy, senior consultant at Magenic
Technologies
–
–
–
–
www.magenic.com
[email protected]
Email your questions
Send an email in order to receive the link to session materials. Allow a
few days to post
– Feedback
CSLA
•
•
•
•
Component based, scalable, logical architecture
Application framework
CSLA Author – Rockford Lhotka
Resources
–
–
–
–
–
www.lhotka.net
Download CSLA from the web side
Download project tracker setup document
Purchase the book 2.1 / 3.0
Available in C# and VB.NET
What is CSLA?
•
•
•
•
•
CSLA .NET is a software development framework that helps you build a powerful,
maintainable business logic layer for Windows, Web, service-oriented and workflow
applications.
Helping to manage and implement this business logic is the purpose of CSLA .NET
CSLA .NET enables you to create an object-oriented business layer that abstracts and
encapsulates your business logic and data. The framework automatically supports data
binding for Windows Forms, Web Forms and WPF. It also supports workflow, WCF and web
services interfaces. CSLA .NET simplifies and standardizes implementation of validation and
authorization logic within your objects.
CSLA .NET also includes a technology-neutral client/server abstraction, allowing you to build
your application and then decide at deployment whether to use 2-tier or 3-tier client/server.
If you opt for 3-tier deployment, you can choose between WCF, .NET Remoting, Web Services
or Enterprise Services as a network protocol. The key point here is that you can switch
between 2-tier and any of these 3-tier networking options without changing your UI,
business logic or data access code; all that changes is a configuration file (and of course
deployment to both client and server).
Finally, CSLA .NET provides a clearly defined location in your architecture where you get data
from or put data into the database. This is not the focus of CSLA .NET, and so the framework’s
goal is to put you in charge. To give you optimum flexibility in how that data is managed and
to enable decoupling of the data access from the business object and user interface or
presentation layers.
What is CSLA?
• Supports rich UI and business layer creation through
–
–
–
–
Data binding
Validation
Business rules
Authorization / authentication
CSLA
• Advantages of framework
–
–
–
–
–
–
Has been around for over 10 years
Proven and stable
Large and active community
Consistent and simple coding techniques
Object oriented analysis and design
Focus on business rules, not technology
• Versions
– Current version 3.0
– Version 3.5 is in beta
CSLA
•
•
•
•
Logical application architecture / model
Physical application architecture / model
Performance and scalability
Security
– Authorization
– Authentication
• Layering
–
–
–
–
–
Presentation
UI
Business Layer
Data access
Data and storage management
CSLA
• Enabling data objects in .NET
– Data binding in Win Forms, WPF and Web Forms
– Validation rules – abstract, consistent coding techniques
– Authorization rules – centralized per property or per object access
rules, defining read and write access
– N-level undo, single level is used most often
– Abstract persistence
• Business objects in CSLA are mobile, thus assisting in scalability of entire framework
CSLA
• Key classes in the framework
–
–
–
–
–
–
–
Data Portal module
Business Base
Business List Base
Read Only Base
Read Only List Base
Command Base
Business Principal Base
• Building object graphs
– Data population
– Data Updates / Transactional support
CSLA
• Helper Classes
–
–
–
–
–
–
–
Safe Data Reader
Object Adapter
Data Mapper
Smart Date
Sorted Binding List
Filtered Binding List
Name / Value List
• Application Context
–
–
–
–
Local Context
Client Context
Global Context
User
CSLA Business Object
• Business Object In Detail
– Inherits from Business Base
– Is a generic class
– Key regions of a typical business object
•
•
•
•
•
Properties
Authorization Rules
Validation Rules
Factory Methods
Data Access
CSLA Business Object’s Properties
• Typical property code
• Purpose of PropertyHasChanged()
– Mark object as dirty
– Raise PropertyChanged Event
– Run Validation Rules
•
•
•
•
Purpose of CanReadProperty and CanWriteProperty
IsDirty()
IsValid()
IsNew()
Business Objects / UI Interaction
• Windows form code
– Display Name
– Error Provider
– Enabling / Disabling of buttons
• Enable Save / Cancel buttons based on edits
• Disable Save button based on validity of objects
• WPF form code
• Web form code
CSLA Configuration
• Data Portal configuration
– App.config / web.config
• Communication protocol sections and configuration
–
–
–
–
Web Services
Remoting (IIS hosted or Windows Service)
Enterprise Services (COM+)
WCF (with all options available in WCF itself)
• Unit testing
Code Generation
• CodeSmith templates
• Templates that come in download of CSLA
• How to create your own template to write classes from
scratch
• Database based classes generation
CSLA / ORM
• CSLA is NOT and ORM
• You can use CSLA data retrieval / update methods to function
as ORM adapter for CSLA business objects
• You can
– Combine multiple tables into single object (pivot)
– You can split one table into multiple objects (unpivot)
– Arbitrarily form data into objects
• Important: CSLA business object and row from a table in a
database do not have to be one and the same. Although a lot
of the time they are.
Questions?