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

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 ConcernsMike Byrne
 
IEEE SE2012 Internet-based self-services
IEEE SE2012 Internet-based self-servicesIEEE SE2012 Internet-based self-services
IEEE SE2012 Internet-based self-servicesJorge 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 deansIndia Scrum Enthusiasts Community
 
Java Design Patterns Tutorial | Edureka
Java Design Patterns Tutorial | EdurekaJava Design Patterns Tutorial | Edureka
Java Design Patterns Tutorial | EdurekaEdureka!
 
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)iotest
 
Clean architecture with asp.net core
Clean architecture with asp.net coreClean architecture with asp.net core
Clean architecture with asp.net coreSam Nasr, MCSA, MVP
 
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 ChallengeAdrian Cockcroft
 
SOA Solution Patterns
SOA Solution PatternsSOA Solution Patterns
SOA Solution PatternsWSO2
 
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 MVCPaul Jones
 
.NET Architecture for Enterprises
.NET Architecture for Enterprises.NET Architecture for Enterprises
.NET Architecture for EnterprisesWade Wegner
 
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 ArchitecturesObeo
 
Lecture 12 requirements modeling - (system analysis)
Lecture 12   requirements modeling - (system analysis)Lecture 12   requirements modeling - (system analysis)
Lecture 12 requirements modeling - (system analysis)IIUI
 
Building Intelligent Solutions with AWS IoT
Building Intelligent Solutions with AWS IoT Building Intelligent Solutions with AWS IoT
Building Intelligent Solutions with AWS IoT Amazon Web Services
 
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...Alberto Brandolini
 
Code instrumentation
Code instrumentationCode instrumentation
Code instrumentationMennan Tekbir
 
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-9AHM Pervej Kabir
 
Lanzamiento Visual Studio 2012 - Modern ALM
Lanzamiento Visual Studio 2012 - Modern ALMLanzamiento Visual Studio 2012 - Modern ALM
Lanzamiento Visual Studio 2012 - Modern ALMDebora 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

BIT Khushi gandhi project.pdf graphic design
BIT Khushi gandhi project.pdf graphic designBIT Khushi gandhi project.pdf graphic design
BIT Khushi gandhi project.pdf graphic designKhushiGandhi15
 
Design lessons from Singapore | Volume 3
Design lessons from Singapore | Volume 3Design lessons from Singapore | Volume 3
Design lessons from Singapore | Volume 3Remy Rey De Barros
 
Bit Dhrumi shah Graphic Designer portfolio
Bit Dhrumi shah Graphic Designer portfolioBit Dhrumi shah Graphic Designer portfolio
Bit Dhrumi shah Graphic Designer portfoliodhrumibshah13
 
Design Portofolios - Licensed Architect / BIM Specialist
Design Portofolios - Licensed Architect / BIM SpecialistDesign Portofolios - Licensed Architect / BIM Specialist
Design Portofolios - Licensed Architect / BIM SpecialistYudistira
 
Dos And Dont's Of Logo Design For 2024..
Dos And Dont's Of Logo Design For 2024..Dos And Dont's Of Logo Design For 2024..
Dos And Dont's Of Logo Design For 2024..GB Logo Design
 
Presentation on 3D Printing.pptx presentation
Presentation on 3D Printing.pptx presentationPresentation on 3D Printing.pptx presentation
Presentation on 3D Printing.pptx presentationajroy0196
 
Spring 2024 wkrm_Enhancing Campus Mobility.pdf
Spring 2024 wkrm_Enhancing Campus Mobility.pdfSpring 2024 wkrm_Enhancing Campus Mobility.pdf
Spring 2024 wkrm_Enhancing Campus Mobility.pdfJon Freach
 
Abdulaziz Tariq Abdulaziz Mustafa CV 2024
Abdulaziz Tariq Abdulaziz Mustafa CV 2024Abdulaziz Tariq Abdulaziz Mustafa CV 2024
Abdulaziz Tariq Abdulaziz Mustafa CV 2024Abdulaziz Mustafa
 
NO1 Popular kala jadu karne wale ka contact number kala jadu karne wale baba ...
NO1 Popular kala jadu karne wale ka contact number kala jadu karne wale baba ...NO1 Popular kala jadu karne wale ka contact number kala jadu karne wale baba ...
NO1 Popular kala jadu karne wale ka contact number kala jadu karne wale baba ...Amil baba
 
Heidi Livengood's Professional CADD Portfolio
Heidi Livengood's Professional CADD PortfolioHeidi Livengood's Professional CADD Portfolio
Heidi Livengood's Professional CADD PortfolioHeidiLivengood
 
Claire's designing portfolio presentation
Claire's designing portfolio presentationClaire's designing portfolio presentation
Claire's designing portfolio presentationssuser8fae18
 
spColumn-Manual design column by spcolumn software.pdf
spColumn-Manual design column by spcolumn software.pdfspColumn-Manual design column by spcolumn software.pdf
spColumn-Manual design column by spcolumn software.pdfChan Thorn
 
一比一原版谢菲尔德大学毕业证成绩单如何办理
一比一原版谢菲尔德大学毕业证成绩单如何办理一比一原版谢菲尔德大学毕业证成绩单如何办理
一比一原版谢菲尔德大学毕业证成绩单如何办理cyebo
 
Week of Action 2022_EIT Climate-KIC_Headers
Week of Action 2022_EIT Climate-KIC_HeadersWeek of Action 2022_EIT Climate-KIC_Headers
Week of Action 2022_EIT Climate-KIC_Headersekinlvnt
 
Knowing, Understanding and Planning Cities- Role and Relevance Physical Plan...
Knowing, Understanding and Planning Cities- Role and Relevance  Physical Plan...Knowing, Understanding and Planning Cities- Role and Relevance  Physical Plan...
Knowing, Understanding and Planning Cities- Role and Relevance Physical Plan...JIT KUMAR GUPTA
 
Recycled Modular Low Cost Construction .pdf
Recycled Modular Low Cost Construction .pdfRecycled Modular Low Cost Construction .pdf
Recycled Modular Low Cost Construction .pdfjeffreycarroll14
 
iF_Design_Trend_Report_twentytwenrythree
iF_Design_Trend_Report_twentytwenrythreeiF_Design_Trend_Report_twentytwenrythree
iF_Design_Trend_Report_twentytwenrythreeCarlgaming1
 
Eric Parein CV. Parein in English is best pronounced as PARE-IN
Eric Parein CV. Parein in English is best pronounced as PARE-INEric Parein CV. Parein in English is best pronounced as PARE-IN
Eric Parein CV. Parein in English is best pronounced as PARE-INEric Parein
 
Heuristic Evaluation of System & Application
Heuristic Evaluation of System & ApplicationHeuristic Evaluation of System & Application
Heuristic Evaluation of System & ApplicationJaime Brown
 
Redefining Globalization, urbanisation and Localisation
Redefining Globalization, urbanisation and LocalisationRedefining Globalization, urbanisation and Localisation
Redefining Globalization, urbanisation and LocalisationJIT KUMAR GUPTA
 

Último (20)

BIT Khushi gandhi project.pdf graphic design
BIT Khushi gandhi project.pdf graphic designBIT Khushi gandhi project.pdf graphic design
BIT Khushi gandhi project.pdf graphic design
 
Design lessons from Singapore | Volume 3
Design lessons from Singapore | Volume 3Design lessons from Singapore | Volume 3
Design lessons from Singapore | Volume 3
 
Bit Dhrumi shah Graphic Designer portfolio
Bit Dhrumi shah Graphic Designer portfolioBit Dhrumi shah Graphic Designer portfolio
Bit Dhrumi shah Graphic Designer portfolio
 
Design Portofolios - Licensed Architect / BIM Specialist
Design Portofolios - Licensed Architect / BIM SpecialistDesign Portofolios - Licensed Architect / BIM Specialist
Design Portofolios - Licensed Architect / BIM Specialist
 
Dos And Dont's Of Logo Design For 2024..
Dos And Dont's Of Logo Design For 2024..Dos And Dont's Of Logo Design For 2024..
Dos And Dont's Of Logo Design For 2024..
 
Presentation on 3D Printing.pptx presentation
Presentation on 3D Printing.pptx presentationPresentation on 3D Printing.pptx presentation
Presentation on 3D Printing.pptx presentation
 
Spring 2024 wkrm_Enhancing Campus Mobility.pdf
Spring 2024 wkrm_Enhancing Campus Mobility.pdfSpring 2024 wkrm_Enhancing Campus Mobility.pdf
Spring 2024 wkrm_Enhancing Campus Mobility.pdf
 
Abdulaziz Tariq Abdulaziz Mustafa CV 2024
Abdulaziz Tariq Abdulaziz Mustafa CV 2024Abdulaziz Tariq Abdulaziz Mustafa CV 2024
Abdulaziz Tariq Abdulaziz Mustafa CV 2024
 
NO1 Popular kala jadu karne wale ka contact number kala jadu karne wale baba ...
NO1 Popular kala jadu karne wale ka contact number kala jadu karne wale baba ...NO1 Popular kala jadu karne wale ka contact number kala jadu karne wale baba ...
NO1 Popular kala jadu karne wale ka contact number kala jadu karne wale baba ...
 
Heidi Livengood's Professional CADD Portfolio
Heidi Livengood's Professional CADD PortfolioHeidi Livengood's Professional CADD Portfolio
Heidi Livengood's Professional CADD Portfolio
 
Claire's designing portfolio presentation
Claire's designing portfolio presentationClaire's designing portfolio presentation
Claire's designing portfolio presentation
 
spColumn-Manual design column by spcolumn software.pdf
spColumn-Manual design column by spcolumn software.pdfspColumn-Manual design column by spcolumn software.pdf
spColumn-Manual design column by spcolumn software.pdf
 
一比一原版谢菲尔德大学毕业证成绩单如何办理
一比一原版谢菲尔德大学毕业证成绩单如何办理一比一原版谢菲尔德大学毕业证成绩单如何办理
一比一原版谢菲尔德大学毕业证成绩单如何办理
 
Week of Action 2022_EIT Climate-KIC_Headers
Week of Action 2022_EIT Climate-KIC_HeadersWeek of Action 2022_EIT Climate-KIC_Headers
Week of Action 2022_EIT Climate-KIC_Headers
 
Knowing, Understanding and Planning Cities- Role and Relevance Physical Plan...
Knowing, Understanding and Planning Cities- Role and Relevance  Physical Plan...Knowing, Understanding and Planning Cities- Role and Relevance  Physical Plan...
Knowing, Understanding and Planning Cities- Role and Relevance Physical Plan...
 
Recycled Modular Low Cost Construction .pdf
Recycled Modular Low Cost Construction .pdfRecycled Modular Low Cost Construction .pdf
Recycled Modular Low Cost Construction .pdf
 
iF_Design_Trend_Report_twentytwenrythree
iF_Design_Trend_Report_twentytwenrythreeiF_Design_Trend_Report_twentytwenrythree
iF_Design_Trend_Report_twentytwenrythree
 
Eric Parein CV. Parein in English is best pronounced as PARE-IN
Eric Parein CV. Parein in English is best pronounced as PARE-INEric Parein CV. Parein in English is best pronounced as PARE-IN
Eric Parein CV. Parein in English is best pronounced as PARE-IN
 
Heuristic Evaluation of System & Application
Heuristic Evaluation of System & ApplicationHeuristic Evaluation of System & Application
Heuristic Evaluation of System & Application
 
Redefining Globalization, urbanisation and Localisation
Redefining Globalization, urbanisation and LocalisationRedefining Globalization, urbanisation and Localisation
Redefining Globalization, urbanisation and Localisation
 

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