visual studio net 2005 using rad tools for n tier development n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Visual Studio.NET 2005 Using RAD Tools for N-Tier Development PowerPoint Presentation
Download Presentation
Visual Studio.NET 2005 Using RAD Tools for N-Tier Development

Loading in 2 Seconds...

play fullscreen
1 / 26

Visual Studio.NET 2005 Using RAD Tools for N-Tier Development - PowerPoint PPT Presentation


  • 118 Views
  • Uploaded on

Visual Studio.NET 2005 Using RAD Tools for N-Tier Development. Andy Beaulieu MCT, MCSD.NET. Drag/Drop Apps?. Demo Using Server Explorer Drag/Drop Table onto Page Use Smart Tag for Formatting No code is generated; instead, everything is “declarative”. Drag/Drop Apps?.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

Visual Studio.NET 2005 Using RAD Tools for N-Tier Development


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
drag drop apps
Drag/Drop Apps?
  • Demo
    • Using Server Explorer
    • Drag/Drop Table onto Page
    • Use Smart Tag for Formatting
    • No code is generated; instead, everything is “declarative”
drag drop apps1
Drag/Drop Apps?

Looking at the source view…

pros and cons
Pros and Cons
  • Pros
    • Very fast
    • Little coding knowledge required
  • Cons
    • Easy to break (no validation)
    • 2Tier Architecture
    • No reusability
    • Limited functionality (at some point, you have to code).
n tier architecture
N-Tier Architecture
  • With a bit more work, we can still use RAD tools but get an N-Tier Architecture.
  • N-Tier provides reusability, scalability, maintainability.
data access layer
Data Access Layer
  • Provides “Programmer Friendly” components for retrieving and updating data
  • Developer is freed from writing mundane and error-prone ADO.NET code
  • Instead can concentrate on Business Logic
data access layer1
Data Access Layer
  • TableAdapter is a new class ideal for creating DAL components
  • Exists within context of a Typed DataSet
  • Contains DB Connection logic, Select, Insert, Update, Delete commands.
data access layer2
Data Access Layer

DEMO: Using VS.NET 2005 Designers to create a DAL component (Typed DataSet + TableAdapter)

data access layer3
Data Access Layer

Note on WindowsForms Clients:

  • WindowsForms clients can take advantage of DataSet events for validation!
  • Provides strongly typed row argument
  • Not usable from ASP.NET client using ObjectDataSource
business logic layer
Business Logic Layer
  • provides validation and workflow
  • We will extend the Data Access Layer to provide BLL layer
  • New ObjectDataSource component allows data binding between UI and BLL components
business logic layer1
Business Logic Layer
  • If we want to use ObjectDataSource component for data binding, we must follow some rules…
business logic layer rules for objectdatasource
Business Logic LayerRules for ObjectDataSource
  • “select” methods must return a DataSet, Typed DataSet, IEnumerable implementation, Collection, or Array.

Public Function GetCustomers() As DataSet

Public Function GetCustomers() As CustomerDataSet

Public Function GetCustomers() As CustomerCollection

business logic layer rules for objectdatasource1
Business Logic LayerRules for ObjectDataSource
  • Insert, update, delete methods must take each field as individual parameters, or a single object containing fields as properties

Public Sub Update(ByVal CustomerId As String, _

ByVal CompanyName As String, _ByVal Address As String, ByVal City As String)

Public Sub Update(ByVal oCustomersBLL As CustomersBLL)

business logic layer2
Business Logic Layer
  • Good News:The TableAdapter conforms to the requirements of the ObjectDataSource control!
  • This means we can extend the TableAdapter control to add our own customizations such as validation
business logic layer3
Business Logic Layer

DEMO: Creating the Business Logic Layer Component

presentation layer web ui
Presentation LayerWeb UI
  • User interface
  • Input and validation
  • ObjectDataSource can be used to bind UI Elements to Business Logic Layer components
presentation layer web ui1
Presentation LayerWeb UI

DEMO: Creating an input page using the GridView, ObjectDataSource, and BLL Component

adding validation web ui
Adding ValidationWeb UI
  • GridView class exposes a RowUpdated event which is fired whenever a row is updated

Protected Sub GridView1_RowUpdated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdatedEventArgs) Handles GridView1.RowUpdated

adding validation web ui1
Adding ValidationWeb UI
  • RowUpdated Event e.Exception argument will contain any errors raised from the update

Protected Sub GridView1_RowUpdated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdatedEventArgs) Handles GridView1.RowUpdated

If Not e.Exception Is Nothing Then

adding validation web ui2
Adding ValidationWeb UI
  • We can create a Custom Exception Class to raise Validation errors through the ObjectDataSource component’s Update Event.
  • CExceptionDetail will hold single error
  • CValidationException inherits from ApplicationException and holds List of CExceptionDetail.
adding validation web ui3
Adding ValidationWeb UI

DEMO: Adding Validation to the Web UI

presentation layer winforms ui
Presentation LayerWinForms UI
  • We can reuse Business Logic Layer in WinForms Client
  • Why WinForms?
    • “Smart Client”
    • WinForms are “statefull”
    • Better DataBinding support
    • Easy Distribution
    • Web Browsers Suck!!!
presentation layer winforms ui1
Presentation LayerWinForms UI

DEMO: Creating the Windows UI

adding validation winforms ui
Adding ValidationWinForms UI

DEMO: Adding Validation to WinForms

a quick word about transactions
A Quick word about Transactions

For Web UI’s, look at Transaction Attribute on Page

For WinForms UI’s, look at new System.Transactions.TransactionScope

Ideally, should Introduce Business Façade Layer for Winforms