SlideShare una empresa de Scribd logo
1 de 12
Design Patterns| What is a Pattern?




                        A Design Pattern is essentially a
                        description of a commonly occurring
                        object-oriented design problem and how
                        to solve it
Design Patterns| An object-oriented design problem

         Imagine a system that uses a number of temperature sensors to monitor the condition of a
         hardware device of some sort.

         The first model of the device uses Indus, Inc. TS7000 sensors.

         Indus supplies a simple Java class to interface with the sensors:

               class TS7000 {
                      native double getTemp();
                      ...
               }
         Here is some monitoring code that simply calculates the mean temperature reported by the sensors.

               double sum = 0.0;
               for (int i = 0; i < sensors.length; i++)
               sum += sensors[i].getTemp();
               double meanTemp = sum / sensors.length;

         Note that sensors is declared as an array of TS7000 objects.

         (TS7000 sensors[ ] = new TS7000[...])
Design Patterns| An object-oriented design problem
         The second model of the device uses more temperature sensors and the design uses a mix of
         TS7000s and sensors from a new vendor, eSoft.

         The eSoftsensors are SuperTemps and a hardware interfacing class is supplied:

               class SuperTempReader {
                      //
                      // NOTE: temperature is Celsius tenths of a degree
                      //
                      native double current_reading();
                      ...
                      }
                            Here is a terrible way to accommodate both types of sensors:
                            for (int i = 0; i < sensors.length; i++)
                      {

                      if (sensors[i] typeof TS7000)
                      sum += ((TS7000)sensors[i]).getTemp();
                      else
                      // Must be a SuperTemp!
                      sum +=
                      ((SuperTempReader)sensors[i]).current_reading() * 10;
                }
         In this case sensors is an array of Objects. The type is tested with
         typeof and an appropriate cast and method call is performed.
Design Patterns| A pattern to the rescue!




                             Any problems here?

                             What's terrible about this code?

                             Which pattern is suitable for it?

                             Types of Patterns
                                      - Classification
                                      - GOF
Design Patterns| Patterns for Web application development



                         Web development Issues
                                - automated testing
                                - UI are hard to test
                                - Changing nature of web
                                - Frequent changes in UI Design

                         How to solve this issue?
                                 - Separate UI and Business Objects

                         MVC
                                    - Model View Controller
                         MVP
                                    - Model View Presenter
Design Patterns| Model – View - Controller




                                                      Request




                                                                  Response
                                          nd   Controller
                                        ma



                                                 ta
                                      De



                                               Da



                                     Model                      View
Design Patterns| Model – View - Presenter



                                          Model




                                                  Demand
                                 Data
                                  Presenter

                                                             View Interface

                                     View
                                Implementation    Response
                                Request
Design Patterns| ASP.NET MVC 3




              A part of the ASP.NET Web application framework

              It enables clean separation of concerns, testability, and
              TDD by default

              It is highly extensible and pluggable
Design Patterns| Web Client Software Factory


      Quickly incorporate many of the proven practices and patterns of building
      Web client applications

      Provides proven solutions to common challenges found while building and
      operating large transaction processing enterprise Web sites

      Support for the Model-View-Presenter pattern

      Contains a collection of
                 reusable components and libraries,
                 Visual Studio 2005 and Visual Studio 2008 solution templates, wizards and extensions,
                 How-to topics,
                 automated tests,
                 extensive architecture documentation,
                 patterns,
                 and a reference implementation
Design Patterns| Demo
Itp design patterns - 2003

Más contenido relacionado

Similar a Itp design patterns - 2003

IEEE SE2012 Internet-based self-services
IEEE SE2012 Internet-based self-servicesIEEE SE2012 Internet-based self-services
IEEE SE2012 Internet-based self-services
Jorge Cardoso
 
Using feature teams_to_deliver_higher_business_value-sameer deans
Using feature teams_to_deliver_higher_business_value-sameer deansUsing feature teams_to_deliver_higher_business_value-sameer deans
Using feature teams_to_deliver_higher_business_value-sameer deans
India Scrum Enthusiasts Community
 
.NET Architecture for Enterprises
.NET Architecture for Enterprises.NET Architecture for Enterprises
.NET Architecture for Enterprises
Wade Wegner
 
Lanzamiento Visual Studio 2012 - Modern ALM
Lanzamiento Visual Studio 2012 - Modern ALMLanzamiento Visual Studio 2012 - Modern ALM
Lanzamiento Visual Studio 2012 - Modern ALM
Debora Di Piano
 

Similar a Itp design patterns - 2003 (20)

Architecting C Sharp for Cross Cutting Concerns
Architecting C Sharp for Cross Cutting ConcernsArchitecting C Sharp for Cross Cutting Concerns
Architecting C Sharp for Cross Cutting Concerns
 
JAX 08 - Agile RCP
JAX 08 - Agile RCPJAX 08 - Agile RCP
JAX 08 - Agile RCP
 
IEEE SE2012 Internet-based self-services
IEEE SE2012 Internet-based self-servicesIEEE SE2012 Internet-based self-services
IEEE SE2012 Internet-based self-services
 
Using feature teams_to_deliver_higher_business_value-sameer deans
Using feature teams_to_deliver_higher_business_value-sameer deansUsing feature teams_to_deliver_higher_business_value-sameer deans
Using feature teams_to_deliver_higher_business_value-sameer deans
 
Java Design Patterns Tutorial | Edureka
Java Design Patterns Tutorial | EdurekaJava Design Patterns Tutorial | Edureka
Java Design Patterns Tutorial | Edureka
 
Internet of Things Environment for Service Creation and Testing (IoT.est)
Internet of Things Environment for Service Creation and Testing (IoT.est)Internet of Things Environment for Service Creation and Testing (IoT.est)
Internet of Things Environment for Service Creation and Testing (IoT.est)
 
J2EE pattern 5
J2EE pattern 5J2EE pattern 5
J2EE pattern 5
 
Clean architecture with asp.net core
Clean architecture with asp.net coreClean architecture with asp.net core
Clean architecture with asp.net core
 
Gluecon Monitoring Microservices and Containers: A Challenge
Gluecon Monitoring Microservices and Containers: A ChallengeGluecon Monitoring Microservices and Containers: A Challenge
Gluecon Monitoring Microservices and Containers: A Challenge
 
SOA Solution Patterns
SOA Solution PatternsSOA Solution Patterns
SOA Solution Patterns
 
L23 Summary and Conclusions
L23 Summary and ConclusionsL23 Summary and Conclusions
L23 Summary and Conclusions
 
Action-Domain-Responder: A Refinement of MVC
Action-Domain-Responder: A Refinement of MVCAction-Domain-Responder: A Refinement of MVC
Action-Domain-Responder: A Refinement of MVC
 
.NET Architecture for Enterprises
.NET Architecture for Enterprises.NET Architecture for Enterprises
.NET Architecture for Enterprises
 
From Model-based to Model and Simulation-based Systems Architectures
From Model-based to Model and Simulation-based Systems ArchitecturesFrom Model-based to Model and Simulation-based Systems Architectures
From Model-based to Model and Simulation-based Systems Architectures
 
Lecture 12 requirements modeling - (system analysis)
Lecture 12   requirements modeling - (system analysis)Lecture 12   requirements modeling - (system analysis)
Lecture 12 requirements modeling - (system analysis)
 
Building Intelligent Solutions with AWS IoT
Building Intelligent Solutions with AWS IoT Building Intelligent Solutions with AWS IoT
Building Intelligent Solutions with AWS IoT
 
Loosely Coupled Complexity - Unleash the power of your Domain Model with Comm...
Loosely Coupled Complexity - Unleash the power of your Domain Model with Comm...Loosely Coupled Complexity - Unleash the power of your Domain Model with Comm...
Loosely Coupled Complexity - Unleash the power of your Domain Model with Comm...
 
Code instrumentation
Code instrumentationCode instrumentation
Code instrumentation
 
Asp.net c# MVC-5 Training-Day-1 of Day-9
Asp.net c# MVC-5 Training-Day-1 of Day-9Asp.net c# MVC-5 Training-Day-1 of Day-9
Asp.net c# MVC-5 Training-Day-1 of Day-9
 
Lanzamiento Visual Studio 2012 - Modern ALM
Lanzamiento Visual Studio 2012 - Modern ALMLanzamiento Visual Studio 2012 - Modern ALM
Lanzamiento Visual Studio 2012 - Modern ALM
 

Último

ab-initio-training basics and architecture
ab-initio-training basics and architectureab-initio-training basics and architecture
ab-initio-training basics and architecture
saipriyacoool
 
Call Girls In Ratnagiri Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service En...
Call Girls In Ratnagiri Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service En...Call Girls In Ratnagiri Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service En...
Call Girls In Ratnagiri Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service En...
Nitya salvi
 
怎样办理伯明翰大学学院毕业证(Birmingham毕业证书)成绩单留信认证
怎样办理伯明翰大学学院毕业证(Birmingham毕业证书)成绩单留信认证怎样办理伯明翰大学学院毕业证(Birmingham毕业证书)成绩单留信认证
怎样办理伯明翰大学学院毕业证(Birmingham毕业证书)成绩单留信认证
eeanqy
 
Q4-Trends-Networks-Module-3.pdfqquater days sheets123456789
Q4-Trends-Networks-Module-3.pdfqquater days sheets123456789Q4-Trends-Networks-Module-3.pdfqquater days sheets123456789
Q4-Trends-Networks-Module-3.pdfqquater days sheets123456789
CristineGraceAcuyan
 
Design-System - FinTech - Isadora Agency
Design-System - FinTech - Isadora AgencyDesign-System - FinTech - Isadora Agency
Design-System - FinTech - Isadora Agency
Isadora Agency
 
Top profile Call Girls In fatehgarh [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In fatehgarh [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In fatehgarh [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In fatehgarh [ 7014168258 ] Call Me For Genuine Models...
gajnagarg
 
Jual Obat Aborsi Bandung ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan ...
Jual Obat Aborsi Bandung ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan ...Jual Obat Aborsi Bandung ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan ...
Jual Obat Aborsi Bandung ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan ...
ZurliaSoop
 
Abortion Pills in Oman (+918133066128) Cytotec clinic buy Oman Muscat
Abortion Pills in Oman (+918133066128) Cytotec clinic buy Oman MuscatAbortion Pills in Oman (+918133066128) Cytotec clinic buy Oman Muscat
Abortion Pills in Oman (+918133066128) Cytotec clinic buy Oman Muscat
Abortion pills in Kuwait Cytotec pills in Kuwait
 
一比一原版(ANU毕业证书)澳大利亚国立大学毕业证原件一模一样
一比一原版(ANU毕业证书)澳大利亚国立大学毕业证原件一模一样一比一原版(ANU毕业证书)澳大利亚国立大学毕业证原件一模一样
一比一原版(ANU毕业证书)澳大利亚国立大学毕业证原件一模一样
yhavx
 
Minimalist Orange Portfolio by Slidesgo.pptx
Minimalist Orange Portfolio by Slidesgo.pptxMinimalist Orange Portfolio by Slidesgo.pptx
Minimalist Orange Portfolio by Slidesgo.pptx
balqisyamutia
 
一比一定(购)西悉尼大学毕业证(WSU毕业证)成绩单学位证
一比一定(购)西悉尼大学毕业证(WSU毕业证)成绩单学位证一比一定(购)西悉尼大学毕业证(WSU毕业证)成绩单学位证
一比一定(购)西悉尼大学毕业证(WSU毕业证)成绩单学位证
eqaqen
 
How to Build a Simple Shopify Website
How to Build a Simple Shopify WebsiteHow to Build a Simple Shopify Website
How to Build a Simple Shopify Website
mark11275
 

Último (20)

ab-initio-training basics and architecture
ab-initio-training basics and architectureab-initio-training basics and architecture
ab-initio-training basics and architecture
 
Call Girls In Ratnagiri Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service En...
Call Girls In Ratnagiri Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service En...Call Girls In Ratnagiri Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service En...
Call Girls In Ratnagiri Escorts ☎️8617370543 🔝 💃 Enjoy 24/7 Escort Service En...
 
怎样办理伯明翰大学学院毕业证(Birmingham毕业证书)成绩单留信认证
怎样办理伯明翰大学学院毕业证(Birmingham毕业证书)成绩单留信认证怎样办理伯明翰大学学院毕业证(Birmingham毕业证书)成绩单留信认证
怎样办理伯明翰大学学院毕业证(Birmingham毕业证书)成绩单留信认证
 
Jordan_Amanda_DMBS202404_PB1_2024-04.pdf
Jordan_Amanda_DMBS202404_PB1_2024-04.pdfJordan_Amanda_DMBS202404_PB1_2024-04.pdf
Jordan_Amanda_DMBS202404_PB1_2024-04.pdf
 
High Profile Escorts Nerul WhatsApp +91-9930687706, Best Service
High Profile Escorts Nerul WhatsApp +91-9930687706, Best ServiceHigh Profile Escorts Nerul WhatsApp +91-9930687706, Best Service
High Profile Escorts Nerul WhatsApp +91-9930687706, Best Service
 
Q4-Trends-Networks-Module-3.pdfqquater days sheets123456789
Q4-Trends-Networks-Module-3.pdfqquater days sheets123456789Q4-Trends-Networks-Module-3.pdfqquater days sheets123456789
Q4-Trends-Networks-Module-3.pdfqquater days sheets123456789
 
Design-System - FinTech - Isadora Agency
Design-System - FinTech - Isadora AgencyDesign-System - FinTech - Isadora Agency
Design-System - FinTech - Isadora Agency
 
Top profile Call Girls In fatehgarh [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In fatehgarh [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In fatehgarh [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In fatehgarh [ 7014168258 ] Call Me For Genuine Models...
 
Jual Obat Aborsi Bandung ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan ...
Jual Obat Aborsi Bandung ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan ...Jual Obat Aborsi Bandung ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan ...
Jual Obat Aborsi Bandung ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan ...
 
Independent Escorts Goregaon WhatsApp +91-9930687706, Best Service
Independent Escorts Goregaon WhatsApp +91-9930687706, Best ServiceIndependent Escorts Goregaon WhatsApp +91-9930687706, Best Service
Independent Escorts Goregaon WhatsApp +91-9930687706, Best Service
 
Abortion Pills in Oman (+918133066128) Cytotec clinic buy Oman Muscat
Abortion Pills in Oman (+918133066128) Cytotec clinic buy Oman MuscatAbortion Pills in Oman (+918133066128) Cytotec clinic buy Oman Muscat
Abortion Pills in Oman (+918133066128) Cytotec clinic buy Oman Muscat
 
一比一原版(ANU毕业证书)澳大利亚国立大学毕业证原件一模一样
一比一原版(ANU毕业证书)澳大利亚国立大学毕业证原件一模一样一比一原版(ANU毕业证书)澳大利亚国立大学毕业证原件一模一样
一比一原版(ANU毕业证书)澳大利亚国立大学毕业证原件一模一样
 
Minimalist Orange Portfolio by Slidesgo.pptx
Minimalist Orange Portfolio by Slidesgo.pptxMinimalist Orange Portfolio by Slidesgo.pptx
Minimalist Orange Portfolio by Slidesgo.pptx
 
Just Call Vip call girls Fatehpur Escorts ☎️8617370543 Two shot with one girl...
Just Call Vip call girls Fatehpur Escorts ☎️8617370543 Two shot with one girl...Just Call Vip call girls Fatehpur Escorts ☎️8617370543 Two shot with one girl...
Just Call Vip call girls Fatehpur Escorts ☎️8617370543 Two shot with one girl...
 
一比一定(购)西悉尼大学毕业证(WSU毕业证)成绩单学位证
一比一定(购)西悉尼大学毕业证(WSU毕业证)成绩单学位证一比一定(购)西悉尼大学毕业证(WSU毕业证)成绩单学位证
一比一定(购)西悉尼大学毕业证(WSU毕业证)成绩单学位证
 
Just Call Vip call girls Kasganj Escorts ☎️8617370543 Two shot with one girl ...
Just Call Vip call girls Kasganj Escorts ☎️8617370543 Two shot with one girl ...Just Call Vip call girls Kasganj Escorts ☎️8617370543 Two shot with one girl ...
Just Call Vip call girls Kasganj Escorts ☎️8617370543 Two shot with one girl ...
 
NO1 Top Pakistani Amil Baba Real Amil baba In Pakistan Najoomi Baba in Pakist...
NO1 Top Pakistani Amil Baba Real Amil baba In Pakistan Najoomi Baba in Pakist...NO1 Top Pakistani Amil Baba Real Amil baba In Pakistan Najoomi Baba in Pakist...
NO1 Top Pakistani Amil Baba Real Amil baba In Pakistan Najoomi Baba in Pakist...
 
Hackathon evaluation template_latest_uploadpdf
Hackathon evaluation template_latest_uploadpdfHackathon evaluation template_latest_uploadpdf
Hackathon evaluation template_latest_uploadpdf
 
Pondicherry Escorts Service Girl ^ 9332606886, WhatsApp Anytime Pondicherry
Pondicherry Escorts Service Girl ^ 9332606886, WhatsApp Anytime PondicherryPondicherry Escorts Service Girl ^ 9332606886, WhatsApp Anytime Pondicherry
Pondicherry Escorts Service Girl ^ 9332606886, WhatsApp Anytime Pondicherry
 
How to Build a Simple Shopify Website
How to Build a Simple Shopify WebsiteHow to Build a Simple Shopify Website
How to Build a Simple Shopify Website
 

Itp design patterns - 2003

  • 1.
  • 2. Design Patterns| What is a Pattern? A Design Pattern is essentially a description of a commonly occurring object-oriented design problem and how to solve it
  • 3. Design Patterns| An object-oriented design problem Imagine a system that uses a number of temperature sensors to monitor the condition of a hardware device of some sort. The first model of the device uses Indus, Inc. TS7000 sensors. Indus supplies a simple Java class to interface with the sensors: class TS7000 { native double getTemp(); ... } Here is some monitoring code that simply calculates the mean temperature reported by the sensors. double sum = 0.0; for (int i = 0; i < sensors.length; i++) sum += sensors[i].getTemp(); double meanTemp = sum / sensors.length; Note that sensors is declared as an array of TS7000 objects. (TS7000 sensors[ ] = new TS7000[...])
  • 4. Design Patterns| An object-oriented design problem The second model of the device uses more temperature sensors and the design uses a mix of TS7000s and sensors from a new vendor, eSoft. The eSoftsensors are SuperTemps and a hardware interfacing class is supplied: class SuperTempReader { // // NOTE: temperature is Celsius tenths of a degree // native double current_reading(); ... } Here is a terrible way to accommodate both types of sensors: for (int i = 0; i < sensors.length; i++) { if (sensors[i] typeof TS7000) sum += ((TS7000)sensors[i]).getTemp(); else // Must be a SuperTemp! sum += ((SuperTempReader)sensors[i]).current_reading() * 10; } In this case sensors is an array of Objects. The type is tested with typeof and an appropriate cast and method call is performed.
  • 5. Design Patterns| A pattern to the rescue! Any problems here? What's terrible about this code? Which pattern is suitable for it? Types of Patterns - Classification - GOF
  • 6. Design Patterns| Patterns for Web application development Web development Issues - automated testing - UI are hard to test - Changing nature of web - Frequent changes in UI Design How to solve this issue? - Separate UI and Business Objects MVC - Model View Controller MVP - Model View Presenter
  • 7. Design Patterns| Model – View - Controller Request Response nd Controller ma ta De Da Model View
  • 8. Design Patterns| Model – View - Presenter Model Demand Data Presenter View Interface View Implementation Response Request
  • 9. Design Patterns| ASP.NET MVC 3 A part of the ASP.NET Web application framework It enables clean separation of concerns, testability, and TDD by default It is highly extensible and pluggable
  • 10. Design Patterns| Web Client Software Factory Quickly incorporate many of the proven practices and patterns of building Web client applications Provides proven solutions to common challenges found while building and operating large transaction processing enterprise Web sites Support for the Model-View-Presenter pattern Contains a collection of reusable components and libraries, Visual Studio 2005 and Visual Studio 2008 solution templates, wizards and extensions, How-to topics, automated tests, extensive architecture documentation, patterns, and a reference implementation