SlideShare a Scribd company logo
1 of 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

More Related Content

Similar to 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 to 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
 

Recently uploaded

一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证
一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证
一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证wpkuukw
 
Real service provider college girl Mira Road 8976425520
Real service provider college girl Mira Road 8976425520Real service provider college girl Mira Road 8976425520
Real service provider college girl Mira Road 8976425520modelanjalisharma4
 
Sector 104, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 104, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 104, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 104, Noida Call girls :8448380779 Model Escorts | 100% verifiedDelhi Call girls
 
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...amitlee9823
 
➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men 🔝jhansi🔝 Escorts S...
➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men  🔝jhansi🔝   Escorts S...➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men  🔝jhansi🔝   Escorts S...
➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men 🔝jhansi🔝 Escorts S...amitlee9823
 
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...Delhi Call girls
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard ...
Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard  ...Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard  ...
Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard ...nirzagarg
 
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 Websitemark11275
 
Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...
Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...
Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...instagramfab782445
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
Q4-W4-SCIENCE-5 power point presentation
Q4-W4-SCIENCE-5 power point presentationQ4-W4-SCIENCE-5 power point presentation
Q4-W4-SCIENCE-5 power point presentationZenSeloveres
 
WhatsApp Chat: 📞 8617697112 Call Girl Baran is experienced
WhatsApp Chat: 📞 8617697112 Call Girl Baran is experiencedWhatsApp Chat: 📞 8617697112 Call Girl Baran is experienced
WhatsApp Chat: 📞 8617697112 Call Girl Baran is experiencedNitya salvi
 
Editorial design Magazine design project.pdf
Editorial design Magazine design project.pdfEditorial design Magazine design project.pdf
Editorial design Magazine design project.pdftbatkhuu1
 
8377087607, Door Step Call Girls In Kalkaji (Locanto) 24/7 Available
8377087607, Door Step Call Girls In Kalkaji (Locanto) 24/7 Available8377087607, Door Step Call Girls In Kalkaji (Locanto) 24/7 Available
8377087607, Door Step Call Girls In Kalkaji (Locanto) 24/7 Availabledollysharma2066
 
AMBER GRAIN EMBROIDERY | Growing folklore elements | Root-based materials, w...
AMBER GRAIN EMBROIDERY | Growing folklore elements |  Root-based materials, w...AMBER GRAIN EMBROIDERY | Growing folklore elements |  Root-based materials, w...
AMBER GRAIN EMBROIDERY | Growing folklore elements | Root-based materials, w...BarusRa
 
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)amitlee9823
 
Booking open Available Pune Call Girls Kirkatwadi 6297143586 Call Hot Indian...
Booking open Available Pune Call Girls Kirkatwadi  6297143586 Call Hot Indian...Booking open Available Pune Call Girls Kirkatwadi  6297143586 Call Hot Indian...
Booking open Available Pune Call Girls Kirkatwadi 6297143586 Call Hot Indian...Call Girls in Nagpur High Profile
 
Whitefield Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Ba...
Whitefield Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Ba...Whitefield Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Ba...
Whitefield Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Ba...amitlee9823
 

Recently uploaded (20)

一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证
一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证
一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证
 
Real service provider college girl Mira Road 8976425520
Real service provider college girl Mira Road 8976425520Real service provider college girl Mira Road 8976425520
Real service provider college girl Mira Road 8976425520
 
Sector 104, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 104, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 104, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 104, Noida Call girls :8448380779 Model Escorts | 100% verified
 
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
 
➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men 🔝jhansi🔝 Escorts S...
➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men  🔝jhansi🔝   Escorts S...➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men  🔝jhansi🔝   Escorts S...
➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men 🔝jhansi🔝 Escorts S...
 
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard ...
Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard  ...Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard  ...
Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard ...
 
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
 
Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...
Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...
Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
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
 
Q4-W4-SCIENCE-5 power point presentation
Q4-W4-SCIENCE-5 power point presentationQ4-W4-SCIENCE-5 power point presentation
Q4-W4-SCIENCE-5 power point presentation
 
WhatsApp Chat: 📞 8617697112 Call Girl Baran is experienced
WhatsApp Chat: 📞 8617697112 Call Girl Baran is experiencedWhatsApp Chat: 📞 8617697112 Call Girl Baran is experienced
WhatsApp Chat: 📞 8617697112 Call Girl Baran is experienced
 
Editorial design Magazine design project.pdf
Editorial design Magazine design project.pdfEditorial design Magazine design project.pdf
Editorial design Magazine design project.pdf
 
8377087607, Door Step Call Girls In Kalkaji (Locanto) 24/7 Available
8377087607, Door Step Call Girls In Kalkaji (Locanto) 24/7 Available8377087607, Door Step Call Girls In Kalkaji (Locanto) 24/7 Available
8377087607, Door Step Call Girls In Kalkaji (Locanto) 24/7 Available
 
AMBER GRAIN EMBROIDERY | Growing folklore elements | Root-based materials, w...
AMBER GRAIN EMBROIDERY | Growing folklore elements |  Root-based materials, w...AMBER GRAIN EMBROIDERY | Growing folklore elements |  Root-based materials, w...
AMBER GRAIN EMBROIDERY | Growing folklore elements | Root-based materials, w...
 
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)
 
Booking open Available Pune Call Girls Kirkatwadi 6297143586 Call Hot Indian...
Booking open Available Pune Call Girls Kirkatwadi  6297143586 Call Hot Indian...Booking open Available Pune Call Girls Kirkatwadi  6297143586 Call Hot Indian...
Booking open Available Pune Call Girls Kirkatwadi 6297143586 Call Hot Indian...
 
Whitefield Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Ba...
Whitefield Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Ba...Whitefield Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Ba...
Whitefield Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Ba...
 

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