SlideShare uma empresa Scribd logo
1 de 32
Don Smith, Program Manager
Microsoft patterns & practices
Agenda
 The data access layer and your options
 Patterns for keeping entities consistent
 Patterns for managing entity differences
 Data access technology assessment
 Other data access challenges
 Summary and questions
Layers & Relationships
    Business
   Business                                       Data
                                                  Data
      Logic            Data Access Layer
    Logic                                        Storage
                                                 Storage
      Layer
    Layer



    Considerations                         Two Options
       Domain complexity                    Keep
       Developer experience                 entities
       Greenfield vs. brownfield            consistent
       Desired approach: data,              Manage their
       code, or model first?                differences
       Object/schema fidelity
Keeping Entities Consistent
 Recommended when            Common patterns
 domain is less complex       Row Data Gateway
 Restricts object-oriented    Table Data Gateway
 design options               Table Module
 Can benefit from code        Active Record
 generation strategies        Record Set
 More difficult to evolve
 over time, but easier to    We have choices
 manage                       Shape of the objects
                              How to combine
                              data and logic
Pre-Built Types
when objects and schema have a simple relationship

  Record Set (DataSet)          TableDataGateway
    Contains the data as rows   Find() : RecordSet
    and columns                 Update(a, b, c)
                                Insert(a, b, c)
  Table Data Gateway            Delete(id)              RecordSet
    Encapsulates all SQL                               Rows
    Can return record sets                             Columns

  Table Module
                                     TableModule
    Accepts a record set
                                Process(RecordSet)
    Contains business logic     Calculate(RecordSet)
Custom Types
when objects and schema have a simple relationship

  Row Data Gateway              RowDataGateway
    Represents a table’s row   ID : long                    ActiveRecord
    Includes all CRUD          FirstName : string
                                                       ID : long
    capability                 LastName : string
                                                       FirstName : string
                               Update(first, last)
  Transaction Script           Insert(first, last)
                                                       LastName : string
                                                       Update(first, last)
    Contains business logic    Delete(id)
                                                       Insert(first, last)
  Active Record                                        Delete(id)
    Represents a table’s row                           Process()

    Contains business logic             TransactionScript
    Includes all CRUD
                                    ProcessCostChange()
    capability                      CalculateAdjustment()
Managing Entity Differences
 Appropriate for         Common patterns
 complex domain logic     Domain Model
 Requires more            Data Mapper
 developer experience     Repository
 Can leverage more OO     Unit of Work
 (GoF) design patterns    Specification
 Appropriate for apps
 that evolve over time
Storefront Overview
    Customer                                                        Retailer



               IE                                             WPF
                      ASP.NET                   Data
                       MVC                    Services
• Searches for                                               • Manages product
  products                                                     information
• Buys products                                              • Maintains
• Views order                         SQL                      inventory
                                     Server
  status                                                     • Processes and
• Rates products                                               ships orders
  and retailers     Broker

                                   • Collects a percentage from each sale
                                   • Views sales & site usage reports
                             Silverlight
Storefront Reference Implementation
Domain Model & Mapping
Domain Model                        Data Mapper
 An object model that                Represents an association of
 represents the domain               types and properties across the
 Contains the combination of         domain model and data model
 data and business logic             Almost always aware of the
 Two basic options                   data access technology
   May be robust and leverage OO     Implementations are often
   principles                        included in O/RM solutions
   May be straightforward in less    Mapping support varies
   complex scenarios
 May have no knowledge of data
 access technology
Repository
 Collection-type interface
 to data access
                                Repository
 Mediates between            GetById(id)
 domain model                GetAll()
                             Add(object)
 and mapper                  Update(object)
                             Delete(id)
 Implementations are
 specific to a technology
Unit of Work
 Maintains a list of new,
 changed and deleted
                                UnitOfWork
 objects and coordinates    SubmitChanges()
 persisting changes         CancelChanges()

 Can be used across
 multiple repositories
Specification/Query Object
 An object that represents
 the criteria of a query
 Allows queries to be            Specification

 easier to manage            Field : string
                             Value : object
 Avoids the need for a       Operator : OpEnum

 method for each query
Technology Assessment
 ADO.NET
   DataSet
   DataAdapter
   DataReader
 LINQ to SQL
   O/RM for simple mappings
 ADO.NET Entity Framework
   O/RM for more complex mappings
Related Challenges
 Domain Model Responsibilities
   Serialization (DTOs)
   Data binding
   Edit tracking
   Validation
 Domain Model Representations
   Subset of the type
   View models
Summary
 Steps for making choices
 1. Determine consistency possibilities between the
    domain model and the data model
       Keep entities consistent
       Manage their differences
 2. Choose shape of the types
      Pre-built
      Custom built
 3. Determine how to attach the business logic
      Influenced by the shape of the types
Resources
 Don’s email:
 dons@microsoft.com
 Project’s community site:
 http://dataguidance.codeplex.com
 Patterns of Enterprise Application Architecture
 http://www.martinfowler.com/eaaCatalog
 The Microsoft Patterns & Practices Team
 http://microsoft.com/practices
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should
 not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS,
                                                                           IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Video Title
Announcement Title
PowerPoint Template
Subtitle color

  Set the slide title in “title case” and subheads in
  “sentence case”
  The subhead color is defined for this template as the
  fourth font color from the left
  Font Size Requirements
     Main bullet points must not be smaller than 24pt
     Do NOT use any font size lower than 20pt
     Set subhead to 36pt or smaller so it will fit
     on a single line
     Turn off Auto Resizing on all text boxes
PowerPoint Guidelines
 Font, size, and color for text have been
 formatted for you in the Slide Master
 Use the color palette shown below
 See next slide for additional guidelines
 Hyperlink color: www.microsoft.com
  Sample    Sample    Sample    Sample      Sample
    Fill      Fill      Fill      Fill        Fill

  Sample    Sample    Sample    Sample      Sample
    Fill      Fill      Fill      Fill        Fill
Instructions on Color Readability
 Colors are brighter when projected, so contrast
 and readability are diminished
  Use black or dark gray text
     only on these colors
    Sample        Sample


             Use white text only on these colors
   Sample           Sample        Sample           Sample

   Sample           Sample        Sample           Sample
Slide for Showing Software Code
Use this layout to show software code
  The font is Consolas, a monospace font
  The slide doesn’t use bullets but levels can be indented
  using the “Increase List Level” icon on the Home menu
  To use straight quotes quot; instead of
  smart quotes ”, do this:
  1.Click on the Office Button in the upper left corner
  2.At the bottom of the menu, choose PowerPoint Options
  3.From the left pane, select Proofing
  4.Click on the AutoCorrect Options button
  5.Select the AutoFormat As You Type tab,
  and deselect “Straight quotes” with “smart
  quotes”. Then Click OK.
Table Format
                       Table Title
 Column 1   Column 2     Column 3    Column 4   Column 5
Bar Chart Example
                                Chart Title
                    Series 1        Series 2     Series 3

                                                                        5
    4.3                   4.4                               4.5

                                         3.5
                                                     3            2.8
          2.4       2.5
                2               2              1.8




    Category 1      Category 2            Category 3        Category 4
Pie Chart Example

           Chart Title
    10%
           9%
                          1st Qtr
     23%            58%
Related Content
Breakout Sessions (session codes and titles)



Interactive Theater Sessions (session codes and titles)



Hands-on Labs (session codes and titles)



Hands-on Labs (session codes and titles)
Track Resources
Resource 1



Resource 2



Resource 3



Resource 4

Mais conteúdo relacionado

Destaque

Silverlight And .Net Ria Services – Building Lob And Business Applications Wi...
Silverlight And .Net Ria Services – Building Lob And Business Applications Wi...Silverlight And .Net Ria Services – Building Lob And Business Applications Wi...
Silverlight And .Net Ria Services – Building Lob And Business Applications Wi...rsnarayanan
 
Harish Understanding Aspnet
Harish Understanding AspnetHarish Understanding Aspnet
Harish Understanding Aspnetrsnarayanan
 
Kevin Ms Web Platform
Kevin Ms Web PlatformKevin Ms Web Platform
Kevin Ms Web Platformrsnarayanan
 
Security Best Practices For Hyper V And Server Virtualization
Security Best Practices For Hyper V And Server VirtualizationSecurity Best Practices For Hyper V And Server Virtualization
Security Best Practices For Hyper V And Server Virtualizationrsnarayanan
 

Destaque (7)

Silverlight And .Net Ria Services – Building Lob And Business Applications Wi...
Silverlight And .Net Ria Services – Building Lob And Business Applications Wi...Silverlight And .Net Ria Services – Building Lob And Business Applications Wi...
Silverlight And .Net Ria Services – Building Lob And Business Applications Wi...
 
Walther Mvc
Walther MvcWalther Mvc
Walther Mvc
 
Walther Ajax4
Walther Ajax4Walther Ajax4
Walther Ajax4
 
Harish Understanding Aspnet
Harish Understanding AspnetHarish Understanding Aspnet
Harish Understanding Aspnet
 
Kevin Ms Web Platform
Kevin Ms Web PlatformKevin Ms Web Platform
Kevin Ms Web Platform
 
Security Best Practices For Hyper V And Server Virtualization
Security Best Practices For Hyper V And Server VirtualizationSecurity Best Practices For Hyper V And Server Virtualization
Security Best Practices For Hyper V And Server Virtualization
 
Walther Aspnet4
Walther Aspnet4Walther Aspnet4
Walther Aspnet4
 

Semelhante a Data Access Tech Ed India

CA ERwin Data Modeler End User Presentation
CA ERwin Data Modeler End User PresentationCA ERwin Data Modeler End User Presentation
CA ERwin Data Modeler End User PresentationCA RMDM Latam
 
2006 DDD4: Data access layers - Convenience vs. Control and Performance?
2006 DDD4: Data access layers - Convenience vs. Control and Performance?2006 DDD4: Data access layers - Convenience vs. Control and Performance?
2006 DDD4: Data access layers - Convenience vs. Control and Performance?Daniel Fisher
 
黑豹 ch4 ddd pattern practice (2)
黑豹 ch4 ddd pattern practice (2)黑豹 ch4 ddd pattern practice (2)
黑豹 ch4 ddd pattern practice (2)Fong Liou
 
SQL Server 2008 for Developers
SQL Server 2008 for DevelopersSQL Server 2008 for Developers
SQL Server 2008 for Developersukdpe
 
Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)David McCarter
 
NNUG Certification Presentation
NNUG Certification PresentationNNUG Certification Presentation
NNUG Certification PresentationNiall Merrigan
 
Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)David McCarter
 
Tech Days09 Sqldev
Tech Days09 SqldevTech Days09 Sqldev
Tech Days09 Sqldevllangit
 
SQL Server 2008 for Developers
SQL Server 2008 for DevelopersSQL Server 2008 for Developers
SQL Server 2008 for Developersllangit
 
SQL Server 2008 for .NET Developers
SQL Server 2008 for .NET DevelopersSQL Server 2008 for .NET Developers
SQL Server 2008 for .NET Developersllangit
 
Overview of atg framework
Overview of atg frameworkOverview of atg framework
Overview of atg frameworkYousuf Roushan
 
Entity Framework v1 and v2
Entity Framework v1 and v2Entity Framework v1 and v2
Entity Framework v1 and v2Eric Nelson
 
Data Mining for Developers
Data Mining for DevelopersData Mining for Developers
Data Mining for Developersllangit
 
Training institute in Bangalore
Training institute in BangaloreTraining institute in Bangalore
Training institute in Bangalorepentagonspace1
 
Best training institute
Best training institute Best training institute
Best training institute pentagonspace1
 
Online Datastage training
Online Datastage trainingOnline Datastage training
Online Datastage trainingchpriyaa1
 
Datastage Online Training @ Adithya Elearning
Datastage Online Training @ Adithya ElearningDatastage Online Training @ Adithya Elearning
Datastage Online Training @ Adithya Elearningshanmukha rao dondapati
 
Overview of VS2010 and .NET 4.0
Overview of VS2010 and .NET 4.0Overview of VS2010 and .NET 4.0
Overview of VS2010 and .NET 4.0Bruce Johnson
 

Semelhante a Data Access Tech Ed India (20)

CA ERwin Data Modeler End User Presentation
CA ERwin Data Modeler End User PresentationCA ERwin Data Modeler End User Presentation
CA ERwin Data Modeler End User Presentation
 
2006 DDD4: Data access layers - Convenience vs. Control and Performance?
2006 DDD4: Data access layers - Convenience vs. Control and Performance?2006 DDD4: Data access layers - Convenience vs. Control and Performance?
2006 DDD4: Data access layers - Convenience vs. Control and Performance?
 
黑豹 ch4 ddd pattern practice (2)
黑豹 ch4 ddd pattern practice (2)黑豹 ch4 ddd pattern practice (2)
黑豹 ch4 ddd pattern practice (2)
 
Day5
Day5Day5
Day5
 
SQL Server 2008 for Developers
SQL Server 2008 for DevelopersSQL Server 2008 for Developers
SQL Server 2008 for Developers
 
Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)
 
NNUG Certification Presentation
NNUG Certification PresentationNNUG Certification Presentation
NNUG Certification Presentation
 
Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)
 
Tech Days09 Sqldev
Tech Days09 SqldevTech Days09 Sqldev
Tech Days09 Sqldev
 
SQL Server 2008 for Developers
SQL Server 2008 for DevelopersSQL Server 2008 for Developers
SQL Server 2008 for Developers
 
SQL Server 2008 for .NET Developers
SQL Server 2008 for .NET DevelopersSQL Server 2008 for .NET Developers
SQL Server 2008 for .NET Developers
 
Overview of atg framework
Overview of atg frameworkOverview of atg framework
Overview of atg framework
 
Entity Framework v1 and v2
Entity Framework v1 and v2Entity Framework v1 and v2
Entity Framework v1 and v2
 
Data Mining for Developers
Data Mining for DevelopersData Mining for Developers
Data Mining for Developers
 
Training institute in Bangalore
Training institute in BangaloreTraining institute in Bangalore
Training institute in Bangalore
 
Best training institute
Best training institute Best training institute
Best training institute
 
Online Datastage training
Online Datastage trainingOnline Datastage training
Online Datastage training
 
Datastage Online Training @ Adithya Elearning
Datastage Online Training @ Adithya ElearningDatastage Online Training @ Adithya Elearning
Datastage Online Training @ Adithya Elearning
 
Final Jspring2009 Mda Slimmer Ontwikkelen Van Java Ee Applicaties
Final Jspring2009 Mda Slimmer Ontwikkelen Van Java Ee ApplicatiesFinal Jspring2009 Mda Slimmer Ontwikkelen Van Java Ee Applicaties
Final Jspring2009 Mda Slimmer Ontwikkelen Van Java Ee Applicaties
 
Overview of VS2010 and .NET 4.0
Overview of VS2010 and .NET 4.0Overview of VS2010 and .NET 4.0
Overview of VS2010 and .NET 4.0
 

Mais de rsnarayanan

Harish Aspnet Dynamic Data
Harish Aspnet Dynamic DataHarish Aspnet Dynamic Data
Harish Aspnet Dynamic Datarsnarayanan
 
Harish Aspnet Deployment
Harish Aspnet DeploymentHarish Aspnet Deployment
Harish Aspnet Deploymentrsnarayanan
 
Whats New In Sl3
Whats New In Sl3Whats New In Sl3
Whats New In Sl3rsnarayanan
 
Advanced Silverlight
Advanced SilverlightAdvanced Silverlight
Advanced Silverlightrsnarayanan
 
Occasionally Connected Systems
Occasionally Connected SystemsOccasionally Connected Systems
Occasionally Connected Systemsrsnarayanan
 
Developing Php Applications Using Microsoft Software And Services
Developing Php Applications Using Microsoft Software And ServicesDeveloping Php Applications Using Microsoft Software And Services
Developing Php Applications Using Microsoft Software And Servicesrsnarayanan
 
Build Mission Critical Applications On The Microsoft Platform Using Eclipse J...
Build Mission Critical Applications On The Microsoft Platform Using Eclipse J...Build Mission Critical Applications On The Microsoft Platform Using Eclipse J...
Build Mission Critical Applications On The Microsoft Platform Using Eclipse J...rsnarayanan
 
J Query The Write Less Do More Javascript Library
J Query   The Write Less Do More Javascript LibraryJ Query   The Write Less Do More Javascript Library
J Query The Write Less Do More Javascript Libraryrsnarayanan
 
Ms Sql Business Inteligence With My Sql
Ms Sql Business Inteligence With My SqlMs Sql Business Inteligence With My Sql
Ms Sql Business Inteligence With My Sqlrsnarayanan
 
Windows 7 For Developers
Windows 7 For DevelopersWindows 7 For Developers
Windows 7 For Developersrsnarayanan
 
What Is New In Wpf 3.5 Sp1
What Is New In Wpf 3.5 Sp1What Is New In Wpf 3.5 Sp1
What Is New In Wpf 3.5 Sp1rsnarayanan
 
Ux For Developers
Ux For DevelopersUx For Developers
Ux For Developersrsnarayanan
 
A Lap Around Internet Explorer 8
A Lap Around Internet Explorer 8A Lap Around Internet Explorer 8
A Lap Around Internet Explorer 8rsnarayanan
 
App Arch Guide (Dons)
App Arch Guide (Dons)App Arch Guide (Dons)
App Arch Guide (Dons)rsnarayanan
 
Federated Identity Architectures Integrating With The Cloud
Federated Identity Architectures   Integrating With The CloudFederated Identity Architectures   Integrating With The Cloud
Federated Identity Architectures Integrating With The Cloudrsnarayanan
 
Pnp Agile Tech Ed India
Pnp Agile Tech Ed IndiaPnp Agile Tech Ed India
Pnp Agile Tech Ed Indiarsnarayanan
 
Prism Tech Ed India
Prism Tech Ed IndiaPrism Tech Ed India
Prism Tech Ed Indiarsnarayanan
 
Tech Ed 2009 Creating Strategic Influence On Stake Holders
Tech Ed 2009   Creating Strategic Influence On Stake HoldersTech Ed 2009   Creating Strategic Influence On Stake Holders
Tech Ed 2009 Creating Strategic Influence On Stake Holdersrsnarayanan
 

Mais de rsnarayanan (20)

Harish Aspnet Dynamic Data
Harish Aspnet Dynamic DataHarish Aspnet Dynamic Data
Harish Aspnet Dynamic Data
 
Harish Aspnet Deployment
Harish Aspnet DeploymentHarish Aspnet Deployment
Harish Aspnet Deployment
 
Whats New In Sl3
Whats New In Sl3Whats New In Sl3
Whats New In Sl3
 
Advanced Silverlight
Advanced SilverlightAdvanced Silverlight
Advanced Silverlight
 
Netcf Gc
Netcf GcNetcf Gc
Netcf Gc
 
Occasionally Connected Systems
Occasionally Connected SystemsOccasionally Connected Systems
Occasionally Connected Systems
 
Developing Php Applications Using Microsoft Software And Services
Developing Php Applications Using Microsoft Software And ServicesDeveloping Php Applications Using Microsoft Software And Services
Developing Php Applications Using Microsoft Software And Services
 
Build Mission Critical Applications On The Microsoft Platform Using Eclipse J...
Build Mission Critical Applications On The Microsoft Platform Using Eclipse J...Build Mission Critical Applications On The Microsoft Platform Using Eclipse J...
Build Mission Critical Applications On The Microsoft Platform Using Eclipse J...
 
J Query The Write Less Do More Javascript Library
J Query   The Write Less Do More Javascript LibraryJ Query   The Write Less Do More Javascript Library
J Query The Write Less Do More Javascript Library
 
Ms Sql Business Inteligence With My Sql
Ms Sql Business Inteligence With My SqlMs Sql Business Inteligence With My Sql
Ms Sql Business Inteligence With My Sql
 
Windows 7 For Developers
Windows 7 For DevelopersWindows 7 For Developers
Windows 7 For Developers
 
What Is New In Wpf 3.5 Sp1
What Is New In Wpf 3.5 Sp1What Is New In Wpf 3.5 Sp1
What Is New In Wpf 3.5 Sp1
 
Ux For Developers
Ux For DevelopersUx For Developers
Ux For Developers
 
A Lap Around Internet Explorer 8
A Lap Around Internet Explorer 8A Lap Around Internet Explorer 8
A Lap Around Internet Explorer 8
 
App Arch Guide (Dons)
App Arch Guide (Dons)App Arch Guide (Dons)
App Arch Guide (Dons)
 
Federated Identity Architectures Integrating With The Cloud
Federated Identity Architectures   Integrating With The CloudFederated Identity Architectures   Integrating With The Cloud
Federated Identity Architectures Integrating With The Cloud
 
Pnp Agile Tech Ed India
Pnp Agile Tech Ed IndiaPnp Agile Tech Ed India
Pnp Agile Tech Ed India
 
Prism Tech Ed India
Prism Tech Ed IndiaPrism Tech Ed India
Prism Tech Ed India
 
Tech Ed 2009 Creating Strategic Influence On Stake Holders
Tech Ed 2009   Creating Strategic Influence On Stake HoldersTech Ed 2009   Creating Strategic Influence On Stake Holders
Tech Ed 2009 Creating Strategic Influence On Stake Holders
 
Web 2.0 Futures
Web 2.0 FuturesWeb 2.0 Futures
Web 2.0 Futures
 

Último

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 

Último (20)

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

Data Access Tech Ed India

  • 1.
  • 2. Don Smith, Program Manager Microsoft patterns & practices
  • 3. Agenda The data access layer and your options Patterns for keeping entities consistent Patterns for managing entity differences Data access technology assessment Other data access challenges Summary and questions
  • 4. Layers & Relationships Business Business Data Data Logic Data Access Layer Logic Storage Storage Layer Layer Considerations Two Options Domain complexity Keep Developer experience entities Greenfield vs. brownfield consistent Desired approach: data, Manage their code, or model first? differences Object/schema fidelity
  • 5. Keeping Entities Consistent Recommended when Common patterns domain is less complex Row Data Gateway Restricts object-oriented Table Data Gateway design options Table Module Can benefit from code Active Record generation strategies Record Set More difficult to evolve over time, but easier to We have choices manage Shape of the objects How to combine data and logic
  • 6. Pre-Built Types when objects and schema have a simple relationship Record Set (DataSet) TableDataGateway Contains the data as rows Find() : RecordSet and columns Update(a, b, c) Insert(a, b, c) Table Data Gateway Delete(id) RecordSet Encapsulates all SQL Rows Can return record sets Columns Table Module TableModule Accepts a record set Process(RecordSet) Contains business logic Calculate(RecordSet)
  • 7. Custom Types when objects and schema have a simple relationship Row Data Gateway RowDataGateway Represents a table’s row ID : long ActiveRecord Includes all CRUD FirstName : string ID : long capability LastName : string FirstName : string Update(first, last) Transaction Script Insert(first, last) LastName : string Update(first, last) Contains business logic Delete(id) Insert(first, last) Active Record Delete(id) Represents a table’s row Process() Contains business logic TransactionScript Includes all CRUD ProcessCostChange() capability CalculateAdjustment()
  • 8. Managing Entity Differences Appropriate for Common patterns complex domain logic Domain Model Requires more Data Mapper developer experience Repository Can leverage more OO Unit of Work (GoF) design patterns Specification Appropriate for apps that evolve over time
  • 9. Storefront Overview Customer Retailer IE WPF ASP.NET Data MVC Services • Searches for • Manages product products information • Buys products • Maintains • Views order SQL inventory Server status • Processes and • Rates products ships orders and retailers Broker • Collects a percentage from each sale • Views sales & site usage reports Silverlight
  • 11. Domain Model & Mapping Domain Model Data Mapper An object model that Represents an association of represents the domain types and properties across the Contains the combination of domain model and data model data and business logic Almost always aware of the Two basic options data access technology May be robust and leverage OO Implementations are often principles included in O/RM solutions May be straightforward in less Mapping support varies complex scenarios May have no knowledge of data access technology
  • 12. Repository Collection-type interface to data access Repository Mediates between GetById(id) domain model GetAll() Add(object) and mapper Update(object) Delete(id) Implementations are specific to a technology
  • 13. Unit of Work Maintains a list of new, changed and deleted UnitOfWork objects and coordinates SubmitChanges() persisting changes CancelChanges() Can be used across multiple repositories
  • 14. Specification/Query Object An object that represents the criteria of a query Allows queries to be Specification easier to manage Field : string Value : object Avoids the need for a Operator : OpEnum method for each query
  • 15. Technology Assessment ADO.NET DataSet DataAdapter DataReader LINQ to SQL O/RM for simple mappings ADO.NET Entity Framework O/RM for more complex mappings
  • 16. Related Challenges Domain Model Responsibilities Serialization (DTOs) Data binding Edit tracking Validation Domain Model Representations Subset of the type View models
  • 17. Summary Steps for making choices 1. Determine consistency possibilities between the domain model and the data model Keep entities consistent Manage their differences 2. Choose shape of the types Pre-built Custom built 3. Determine how to attach the business logic Influenced by the shape of the types
  • 18. Resources Don’s email: dons@microsoft.com Project’s community site: http://dataguidance.codeplex.com Patterns of Enterprise Application Architecture http://www.martinfowler.com/eaaCatalog The Microsoft Patterns & Practices Team http://microsoft.com/practices
  • 19.
  • 20. © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
  • 23. PowerPoint Template Subtitle color Set the slide title in “title case” and subheads in “sentence case” The subhead color is defined for this template as the fourth font color from the left Font Size Requirements Main bullet points must not be smaller than 24pt Do NOT use any font size lower than 20pt Set subhead to 36pt or smaller so it will fit on a single line Turn off Auto Resizing on all text boxes
  • 24. PowerPoint Guidelines Font, size, and color for text have been formatted for you in the Slide Master Use the color palette shown below See next slide for additional guidelines Hyperlink color: www.microsoft.com Sample Sample Sample Sample Sample Fill Fill Fill Fill Fill Sample Sample Sample Sample Sample Fill Fill Fill Fill Fill
  • 25. Instructions on Color Readability Colors are brighter when projected, so contrast and readability are diminished Use black or dark gray text only on these colors Sample Sample Use white text only on these colors Sample Sample Sample Sample Sample Sample Sample Sample
  • 26. Slide for Showing Software Code Use this layout to show software code The font is Consolas, a monospace font The slide doesn’t use bullets but levels can be indented using the “Increase List Level” icon on the Home menu To use straight quotes quot; instead of smart quotes ”, do this: 1.Click on the Office Button in the upper left corner 2.At the bottom of the menu, choose PowerPoint Options 3.From the left pane, select Proofing 4.Click on the AutoCorrect Options button 5.Select the AutoFormat As You Type tab, and deselect “Straight quotes” with “smart quotes”. Then Click OK.
  • 27. Table Format Table Title Column 1 Column 2 Column 3 Column 4 Column 5
  • 28. Bar Chart Example Chart Title Series 1 Series 2 Series 3 5 4.3 4.4 4.5 3.5 3 2.8 2.4 2.5 2 2 1.8 Category 1 Category 2 Category 3 Category 4
  • 29. Pie Chart Example Chart Title 10% 9% 1st Qtr 23% 58%
  • 30.
  • 31. Related Content Breakout Sessions (session codes and titles) Interactive Theater Sessions (session codes and titles) Hands-on Labs (session codes and titles) Hands-on Labs (session codes and titles)
  • 32. Track Resources Resource 1 Resource 2 Resource 3 Resource 4

Notas do Editor

  1. To get data out of a database, you have to issue T-SQL statements to it. Scattering these statements throughout the business logic makes the solution more difficult to manage/troubleshoot.Dependencies go out from the DAL! The arrows are showing flow and dependencies.Quality AttributesSeparation of ConcernsEvolvabilityTestabilityPerformance
  2. Most of us know that the practices a team uses when building a solution has a tremendous influence on the code that implements the ultimate solution. Also, the technologies used can either make that process easier or harder. Unit testing is a prime example. So for this project, we’re going to start with building a reference implementation and be very transparent about the process by which we build it. We’ve began with domain modeling and TDD as primary practices and (because we’re only in our second iteration) are considering a switch to a more BDD approach. So let’s talk about the scenario.The goal of the solution is pretty simple – it’s just to broker sales between retailers who are selling products and customers who are buying them. We represent the broker who is building the solution and mostly interested in collecting a percentage of each sale … and we have to manage the solution too of course. Hopefully this diagram will give you sense of the products and technologies we’re going to use and the main things the solution will have to do. We feel pretty good about this scenario because if you’ve used Amazon, it should be familiar to your, and the domain model has an appropriate level of complexity.
  3. If you would like to host your demo on the Virtual Server, please use the myVPC demo slide, not this slide.