SlideShare a Scribd company logo
More on Design Patterns


Pre-assessment Questions

         2.   Which UML diagram depicts the sequential invocation of methods of a
              system?
              a)   Sequence
              b) Collaboration
              c)   Package
              d) Use Case




 ©NIIT                 Architecting J2EE Solutions         Lesson 2B / Slide 1 of 35
More on Design Patterns


Pre-assessment Questions

         2.   Which option identifies the scope of a system in a Use Case diagram
              and is represented by a solid rectangle?
              a)   Use Case
              b)   Message
              c)   Actor
              d)   State boundary




 ©NIIT                  Architecting J2EE Solutions         Lesson 2B / Slide 2 of 35
More on Design Patterns


Pre-assessment Questions

         2.   Consider the statements:
              Statement A: Extent relationship indicates that an existing use case is
                          extended by additional behavior to obtain another use case.
              Statement B: Include relationship indicates that the functions of one
              use case are included in the functions of the other.
               Identify the correct option.
              a)   Statement A is true and statement B is false
              b) Statement A is false and statement B is true
              c)   Both, statements A and B, are true
              d) Both, statements A and B, are false




 ©NIIT                  Architecting J2EE Solutions         Lesson 2B / Slide 3 of 35
More on Design Patterns


Pre-assessment Questions

         2.   Consider the statements:
              Statement A: Component diagram represents the grouping of related
              classes, interfaces, and methods of a given system.
              Statement B: Component diagram elements represent the various
              components of business entities of a given system.
              Identify the correct option.
              a)   Statement A is true and statement B is false
              b) Statement A is false and statement B is true
              c)   Both, statements A and B, are true
              d) Both, statements A and B, are false




 ©NIIT                 Architecting J2EE Solutions       Lesson 2B / Slide 4 of 35
More on Design Patterns


Pre-assessment Questions

         2.   Which element of GoF’s design pattern emphasizes on relationships,
              responsibilities, and collaborations among the constituents of a pattern?
              a)   Pattern name
              b) Solution
              c)   Problem
              d) Consequences




 ©NIIT                  Architecting J2EE Solutions          Lesson 2B / Slide 5 of 35
More on Design Patterns

Solutions to Pre-assessment Questions

         1.   a. Sequence
         2.   d. State boundary
         3.   c. Both, statements A and B, are true
         4.   b. Statement A is false and statement B is true
         5.   b. Solution




 ©NIIT                  Architecting J2EE Solutions         Lesson 2B / Slide 6 of 35
More on Design Patterns


Objectives

         In this lesson you will learn to:


              •   Use Structural Design Patterns
              •   Use Behavioral Design Patterns




 ©NIIT                   Architecting J2EE Solutions   Lesson 2B / Slide 7 of 35
More on Design Patterns


Structural Design Patterns
    •    Structural design patterns
           • Represent the composition of classes and objects.
           • Defines how classes inherit each other.
    •    The class-creation pattern uses inheritance in order to provide more functional
         program interfaces.
    •    The object-creation pattern defines how objects can be composed to provide
         new functionality using object composition.
    •    The various structural design patterns are Adaptor, Bridge, Composite,
         Decorator, Façade, Flyweight, and Proxy.




 ©NIIT                    Architecting J2EE Solutions          Lesson 2B / Slide 8 of 35
More on Design Patterns


Structural Design Patterns (Contd.)
    •    Adapter Pattern
          • The Adapter design pattern
               • Converts the interface of a class into an interface that is required by
                  the client.
          • The advantages of using Adapter design pattern are:
               • Enabling two or more incompatible objects to interact with each
                  other.
               • Making an existing functionality reusable.
          • The participants of Adapter design pattern are:
               • adapterTest : Implements the methods of MouseAdapter class.
               • MouseListener: Receives the mouse events generated.
               • MouseAdapter: Provides blank implementation of the methods
                  defined in the MouseListener abstract class.



 ©NIIT                    Architecting J2EE Solutions          Lesson 2B / Slide 9 of 35
More on Design Patterns


Structural Design Patterns (Contd.)
    •    Class diagram of the Adapter design pattern




 ©NIIT                   Architecting J2EE Solutions   Lesson 2B / Slide 10 of 35
More on Design Patterns


Structural Design Patterns (Contd.)
    •    Bridge Pattern
           • The Bridge design pattern
                • Separates an interface and its implementation. This enables both the
                  interface and its interface to change without affecting each other.
                • Uses encapsulation, aggregation, and inheritance to divide
                  responsibilities into various classes.
           • The advantages of using Bridge design pattern are:
                • Separates the implementation details from interface.
                • Hides implementation details from the client.




 ©NIIT                   Architecting J2EE Solutions        Lesson 2B / Slide 11 of 35
More on Design Patterns


Structural Design Patterns (Contd.)

    •    The participants of Bridge design pattern are:
           • ClientApp: Invokes the methods of ConcreteImplementor1 and
             ConcreteImplementor2 class.
           • Abstraction: Defines the methods that are implemented by
             ConcreteImplementor1 and ConcreteImplementor2 classes.
           • RefinedAbstraction: Extends the methods defined by class, Abstraction.
           • Implementor: Extends the methods of the Abstraction class to the
             implementation classes, ConcreteImplementor1 and
             ConcreteImplementor2.
           • ConcreteImplementor1: Implements the methods defined in the abstract
             class, Implementor.

          •   ConcreteImplementor2: Implements the methods defined in the abstract
              class, Implementor.


 ©NIIT                    Architecting J2EE Solutions      Lesson 2B / Slide 12 of 35
More on Design Patterns


Structural Design Patterns (Contd.)
    •    Class diagram of the Bridge design pattern




 ©NIIT                    Architecting J2EE Solutions   Lesson 2B / Slide 13 of 35
More on Design Patterns


Structural Design Patterns (Contd.)
    •    Composite Pattern
          • The Composite design pattern
              • Composes objects into tree structures.
              • Enables a client to identically treat both the single component and
                 collection of components.
          • The advantages of Composite design pattern are:
              • Adds new components.
              • Describes the hierarchies of a class, which consists of primitive and
                 complex objects.




 ©NIIT                    Architecting J2EE Solutions        Lesson 2B / Slide 14 of 35
More on Design Patterns


Structural Design Patterns (Contd.)
    •    The participants of Composite design pattern are:
         • ClientClass: Invokes methods of an object through Component interface.
         • Component: Declares interface for accessing and managing its child
              components.
         • Leaf: Defines an object in composition, which has no children.
         • Composite: Defines behavior for parent components and stores child
              components.




 ©NIIT                 Architecting J2EE Solutions      Lesson 2B / Slide 15 of 35
More on Design Patterns


Structural Design Patterns (Contd.)
    •    Class diagram of the Composite design pattern




 ©NIIT                 Architecting J2EE Solutions       Lesson 2B / Slide 16 of 35
More on Design Patterns


Structural Design Patterns (Contd.)
    •    Decorator Pattern
         • The Decorator design pattern
             • Enables you to extend the functionality of a particular object of a
                   class and dynamically provide additional responsibilities to it.
             • Uses composition instead of inheritance in order to extend the
                   functionality, the Decorator design pattern.
         • The advantages of using Decorator design pattern are:
             • It makes it easy to code a behavior, by enabling you to create
                   functionality classes.
             • It is more flexible as compared to static inheritance.
             • It improves the extensibility of an object as you code new classes
                   to make a change in functionality.




 ©NIIT                  Architecting J2EE Solutions       Lesson 2B / Slide 17 of 35
More on Design Patterns


Structural Design Patterns (Contd.)
         •   The participants of Decorator design pattern are:
             • Component: Describes the functionality that the client requires.
             • ConcreteComponent: Implements the functionality described in the
                  abstract class, Component and represents the object to which you
                  can add additional functionalities.
             • Decorator: Enables ConcreteDecorator1 and ConcreteDecorator2 to
                  implement the functionality of the abstract class, Component.
             • ConcreteDecorator1: Implements the functionality of the abstract
                  class, Component through the abstract class, Decorator.
             • ConcreteDecorator2: Implements the functionality of the abstract
                  class, Component through the abstract class, Decorator.




 ©NIIT                Architecting J2EE Solutions       Lesson 2B / Slide 18 of 35
More on Design Patterns


Structural Design Patterns (Contd.)
•      Class diagram of the Decorator design pattern




    ©NIIT                 Architecting J2EE Solutions   Lesson 2B / Slide 19 of 35
More on Design Patterns


Structural Design Patterns (Contd.)
    •    Facade Pattern
           • The Façade design pattern
               • Provides a unified interface to a collection of interfaces in a
                  subsystem.
           • The advantages of using Façade design pattern are:
               • Simplifies the interfacing that makes it difficult to use a large amount
                  of coupling.
               • Protects the client from the complex subsystem components.
           • The Façade design pattern has two participants:
               • Façade: Is also a participant of a system that intercepts client
                  requests and dispatches the request to the subsystem to service the
                  client request.
               • SubSystemN: Defines an application, which uses a façade to interact
                  with the client. There can be multiple subsystems in an application,
                  such as SubSystem1, SubSystem2, …, SubSystemN.



 ©NIIT                    Architecting J2EE Solutions         Lesson 2B / Slide 20 of 35
More on Design Patterns

Structural Design Patterns (Contd.)
    •    Class diagram of the Façade design pattern




 ©NIIT                   Architecting J2EE Solutions   Lesson 2B / Slide 21 of 35
More on Design Patterns


Structural Design Patterns (Contd.)
    •    Flyweight Pattern
          • The Flyweight design pattern is used to efficiently share information
               between a large numbers of objects.
          • Several objects may exist in a system, each using some information
               and thereby consuming a large amount of memory.
          • If all the objects share some static information, you can remove that
               information from each object and place in one object.
          • All other objects can refer to this object, thus reducing the memory
               requirement of the system.
          • The object, which contains the common information that is referenced
               by other objects, is known as the flyweight object.




 ©NIIT                Architecting J2EE Solutions       Lesson 2B / Slide 22 of 35
More on Design Patterns


Structural Design Patterns (Contd.)
    •    The advantages of using Flyweight design pattern are:
         • Enabling large amount objects to share information.
         • Making optimum use of memory.
    •    The participants of Flyweight design pattern are:
         • FlyweightFactory: Creates the flyweight objects.
         • Flyweight: Declares an interface to enable the flyweights to interact
              with the abstract state.
         • ClientApp: Invokes the methods of FlyweightFactory class.
         • ConcreteFlyweight: Implements the functionality of the abstract class,
              Flyweight.




 ©NIIT                 Architecting J2EE Solutions      Lesson 2B / Slide 23 of 35
More on Design Patterns


Structural Design Patterns (Contd.)
•      Class diagram of the Flyweight design pattern




    ©NIIT                  Architecting J2EE Solutions   Lesson 2B / Slide 24 of 35
More on Design Patterns


Structural Design Patterns (Contd.)
    •    Proxy Pattern
         • The Proxy design pattern enables you to provide a stand-in object in
              place of another object.
         • The stand-in object receives the requests that are meant for the original
              object and delegates the requests to the original object.
         • The examples of proxy are remote and virtual.
         • A remote proxy object provides a local representation of an object that
              runs in a different address space.




 ©NIIT                 Architecting J2EE Solutions        Lesson 2B / Slide 25 of 35
More on Design Patterns


Structural Design Patterns (Contd.)
         •   The advantages of using Proxy design pattern are:
             • A remote proxy provides location transparency to the client of
                  object.
             • A virtual proxy provides memory optimization be creating objects
                  when required.

         •   The participants of Proxy design pattern are:
             • ClientProgram: Invokes the methods on a remote object.
             • InterfaceMatter: Declares the methods, which are implemented
                  by the Matter class.
             • Matter: An object that provides services to its clients.
             • Proxy: An object that intercepts the requests and delegates them
                  to the original object.




 ©NIIT                Architecting J2EE Solutions      Lesson 2B / Slide 26 of 35
More on Design Patterns


Structural Design Patterns (Contd.)
•      Class diagram of the Proxy design pattern




    ©NIIT                  Architecting J2EE Solutions   Lesson 2B / Slide 27 of 35
More on Design Patterns


Identifying Structural Design Patterns
         •   Problem Statement
             • BlueMoon Inc. provides software consultancy services. The
                  company foresees a high demand for the retail automation
                  software. As a result, BlueMoon Inc. decides to develop Retailer
                  Automation Solution (RAS), which provides the functions to update
                  the inventory, automate the sales record, and reduce the
                  transaction-processing time. RAS needs to be developed in a way
                  that it can be modified according to the specific requirements of
                  each retailer. For this reason, BlueMoon Inc. ensures that RAS is
                  extensible and adaptable, which enables BlueMoon Inc. to reuse
                  the components of the RAS to create customized solutions for
                  different retailers. John, the software consultant at BlueMoon Inc.
                  decides to model the structural diagram and identify the various
                  structural design patterns, which will enable him to reuse the
                  existing components.



 ©NIIT                 Architecting J2EE Solutions        Lesson 2B / Slide 28 of 35
More on Design Patterns


Identifying Structural Design Patterns
  (Contd.)
         •   Solution
             • To solve the preceding problem, perform the following tasks:
                  • Draw the structural diagram of the application.
                  • Identify the Decorator design pattern.
                  • Identify the Proxy design pattern.
                  • Identify the Bridge design pattern.
                  • Identify the Facade design pattern.




 ©NIIT                Architecting J2EE Solutions      Lesson 2B / Slide 29 of 35
More on Design Patterns


Behavioral Design Patterns

    •    The Behavioral design pattern
         • Defines the state, behavior, and communication among the objects.
         • Various Behavioral design patterns are Chain of Responsibility,
              Command, Interpreter, Iterator, Mediator, Memento, Observer, State,
              Strategy, Template Method, and Visitor.
    •    Chain of Responsibility Pattern
         • Chain of Responsibility design pattern
              • Decouples the sender and receiver of a request by introducing a
                   number of objects between them.
         • The advantages of using Chain of Responsibility design pattern are:
              • Enabling a group of classes to act as a single class.
              • Providing flexibility while dividing responsibilities among the
                   objects.


 ©NIIT                 Architecting J2EE Solutions       Lesson 2B / Slide 30 of 35
More on Design Patterns


Behavioral Design Patterns (Contd.)

•      Class diagram of the Chain of Responsibility design pattern




    ©NIIT                  Architecting J2EE Solutions         Lesson 2B / Slide 31 of 35
More on Design Patterns


Behavioral Design Patterns (Contd.)
    •    Command Pattern
         • The Command design pattern
            • Encapsulates a request as an object and enables the queuing and
                logging of requests.
            • Supports undo operations.
         • The advantages of using Command design pattern are:
            • Enables you to execute the commands whenever the resources are
                available.
            • Enables you to add new commands, as the existing classes do not
                change.




 ©NIIT                Architecting J2EE Solutions    Lesson 2B / Slide 32 of 35
More on Design Patterns


Behavioral Design Patterns (Contd.)
•      Class diagram of the Command design pattern




    ©NIIT                Architecting J2EE Solutions   Lesson 2B / Slide 33 of 35
More on Design Patterns


Summary
    •    Structural design patterns that describe the composition of the classes and
         objects. This design pattern introduces a level of indirection between a client
         class and the class that the client wants to use. The various structural design
         patterns are:
         • Adapter: Enables classes of different interfaces work together in a
              single program.
         • Bridge: Separates an interface from its implementation so that either
              can be changed without affecting each other.
         • Composite: Enables a client to identically treat both the single
              component and collection of components.
         • Decorator: Enables you to extend the functionality of a particular object
              and dynamically provide additional responsibilities to it.
         • Façade: provides a unified interface to a collection of interfaces in a
              subsystem.
         • Flyweight: Enable you to share information among a number of objects.
         • Proxy: Enables you to provide a stand-in object in place of another
              object.

 ©NIIT                  Architecting J2EE Solutions          Lesson 2B / Slide 34 of 35
More on Design Patterns


Summary(Contd.)
    •    Behavioral design patterns that describe the behavior of an object. The
         various Behavioral design patterns are Chain of Responsibility, Command,
         Interpreter, Iterator, Mediator, Memento, Observer, State, Strategy,
         Template Method, and Visitor.
         • Chain of Responsibility: Defines a number of classes can handle a
              request without knowing the capabilities of other classes.
         • Command: Dispatches a request to a specific application.




 ©NIIT                  Architecting J2EE Solutions       Lesson 2B / Slide 35 of 35

More Related Content

What's hot

Dacj 4 1-a
Dacj 4 1-aDacj 4 1-a
Dacj 4 1-a
Niit Care
 
Vb net xp_10
Vb net xp_10Vb net xp_10
Vb net xp_10
Niit Care
 
Ajs 2 c
Ajs 2 cAjs 2 c
Ajs 2 c
Niit Care
 
05 architectural design
05 architectural design05 architectural design
4 - Architetture Software - Architecture Portfolio
4 - Architetture Software - Architecture Portfolio4 - Architetture Software - Architecture Portfolio
4 - Architetture Software - Architecture Portfolio
Majong DevJfu
 
Context-Oriented Programming
Context-Oriented ProgrammingContext-Oriented Programming
Context-Oriented Programming
kim.mens
 
Software Patterns
Software PatternsSoftware Patterns
Software Patterns
kim.mens
 
8 - Architetture Software - Architecture centric processes
8 - Architetture Software - Architecture centric processes8 - Architetture Software - Architecture centric processes
8 - Architetture Software - Architecture centric processes
Majong DevJfu
 
2 - Architetture Software - Software architecture
2 - Architetture Software - Software architecture2 - Architetture Software - Software architecture
2 - Architetture Software - Software architecture
Majong DevJfu
 
08 component level_design
08 component level_design08 component level_design
3 f6 9_distributed_systems
3 f6 9_distributed_systems3 f6 9_distributed_systems
3 f6 9_distributed_systems
op205
 
Introducing MDSD
Introducing MDSDIntroducing MDSD
Introducing MDSD
Pedro J. Molina
 
Software Engineering Sample Question paper for 2012
Software Engineering Sample Question paper for 2012Software Engineering Sample Question paper for 2012
Software Engineering Sample Question paper for 2012
Neelamani Samal
 
5 software design
5 software design5 software design
5 software design
cherrybear2014
 
Chapter 2 slides
Chapter 2 slidesChapter 2 slides
Chapter 2 slides
lara_ays
 
3 f6 8_databases
3 f6 8_databases3 f6 8_databases
3 f6 8_databases
op205
 
OO Development 6 - Software Design
OO Development 6 - Software DesignOO Development 6 - Software Design
OO Development 6 - Software Design
Randy Connolly
 
Pitfalls of software product development
Pitfalls of software product developmentPitfalls of software product development
Pitfalls of software product development
Sofismo AG
 
Software design
Software designSoftware design
Sa 006 modifiability
Sa 006 modifiabilitySa 006 modifiability
Sa 006 modifiability
Frank Gielen
 

What's hot (20)

Dacj 4 1-a
Dacj 4 1-aDacj 4 1-a
Dacj 4 1-a
 
Vb net xp_10
Vb net xp_10Vb net xp_10
Vb net xp_10
 
Ajs 2 c
Ajs 2 cAjs 2 c
Ajs 2 c
 
05 architectural design
05 architectural design05 architectural design
05 architectural design
 
4 - Architetture Software - Architecture Portfolio
4 - Architetture Software - Architecture Portfolio4 - Architetture Software - Architecture Portfolio
4 - Architetture Software - Architecture Portfolio
 
Context-Oriented Programming
Context-Oriented ProgrammingContext-Oriented Programming
Context-Oriented Programming
 
Software Patterns
Software PatternsSoftware Patterns
Software Patterns
 
8 - Architetture Software - Architecture centric processes
8 - Architetture Software - Architecture centric processes8 - Architetture Software - Architecture centric processes
8 - Architetture Software - Architecture centric processes
 
2 - Architetture Software - Software architecture
2 - Architetture Software - Software architecture2 - Architetture Software - Software architecture
2 - Architetture Software - Software architecture
 
08 component level_design
08 component level_design08 component level_design
08 component level_design
 
3 f6 9_distributed_systems
3 f6 9_distributed_systems3 f6 9_distributed_systems
3 f6 9_distributed_systems
 
Introducing MDSD
Introducing MDSDIntroducing MDSD
Introducing MDSD
 
Software Engineering Sample Question paper for 2012
Software Engineering Sample Question paper for 2012Software Engineering Sample Question paper for 2012
Software Engineering Sample Question paper for 2012
 
5 software design
5 software design5 software design
5 software design
 
Chapter 2 slides
Chapter 2 slidesChapter 2 slides
Chapter 2 slides
 
3 f6 8_databases
3 f6 8_databases3 f6 8_databases
3 f6 8_databases
 
OO Development 6 - Software Design
OO Development 6 - Software DesignOO Development 6 - Software Design
OO Development 6 - Software Design
 
Pitfalls of software product development
Pitfalls of software product developmentPitfalls of software product development
Pitfalls of software product development
 
Software design
Software designSoftware design
Software design
 
Sa 006 modifiability
Sa 006 modifiabilitySa 006 modifiability
Sa 006 modifiability
 

Viewers also liked

Dacj 1-3 c
Dacj 1-3 cDacj 1-3 c
Dacj 1-3 c
Niit Care
 
Mr Paul Moore.odt retail2016
Mr Paul Moore.odt retail2016Mr Paul Moore.odt retail2016
Mr Paul Moore.odt retail2016
paul moore
 
Physics Tutor
Physics TutorPhysics Tutor
Physics Tutor
SG Physics Tuition
 
Cronograma de Evaluación
Cronograma de EvaluaciónCronograma de Evaluación
Cronograma de Evaluación
Analix Aponte Bonilla
 
concetti elementari per la sicurezza
concetti elementari per la sicurezzaconcetti elementari per la sicurezza
concetti elementari per la sicurezza
Paolo Pasquinelli
 
Tharani Chellandy Resume
Tharani Chellandy ResumeTharani Chellandy Resume
Tharani Chellandy Resume
Tharani Chellandy
 
Ville et mobile : nouvelles pistes de services
Ville et mobile : nouvelles pistes de servicesVille et mobile : nouvelles pistes de services
Ville et mobile : nouvelles pistes de servicesEmile Hooge
 
Management Agile & management 3.0
Management Agile & management 3.0Management Agile & management 3.0
Management Agile & management 3.0
Mustapha BOUBEKRI, MBA, PMP, PMI-ACP
 
Java session08
Java session08Java session08
Java session08
Niit Care
 
Arta conversatiei
Arta conversatieiArta conversatiei
Arta conversatiei
Biro Bela
 
All about studio test
All about studio testAll about studio test
All about studio test
ACADEMY OF FASHION AND ART
 
Portfolio_Mainak Dey
Portfolio_Mainak DeyPortfolio_Mainak Dey
Portfolio_Mainak Dey
Mainak Dey
 
10-etude des carffours
10-etude des carffours10-etude des carffours
10-etude des carffoursMehdid Hichem
 
The 3 e’s of customer experience
The 3 e’s of customer experienceThe 3 e’s of customer experience
The 3 e’s of customer experience
NIIT Technologies
 
la prochaine marque dominante du tourisme air bnb
la prochaine marque dominante du tourisme air bnbla prochaine marque dominante du tourisme air bnb
la prochaine marque dominante du tourisme air bnb
Frederic Gonzalo
 
RAVI RANA HOTEL MANAGEMENT PPT
RAVI RANA HOTEL MANAGEMENT PPTRAVI RANA HOTEL MANAGEMENT PPT
RAVI RANA HOTEL MANAGEMENT PPT
Sameer Gurjar
 
Le marché du logement neuf en Ile de France - 3ème trimestre 2015
Le marché du logement neuf en Ile de France - 3ème trimestre 2015Le marché du logement neuf en Ile de France - 3ème trimestre 2015
Le marché du logement neuf en Ile de France - 3ème trimestre 2015
Monimmeuble.com
 

Viewers also liked (18)

Dacj 1-3 c
Dacj 1-3 cDacj 1-3 c
Dacj 1-3 c
 
Mr Paul Moore.odt retail2016
Mr Paul Moore.odt retail2016Mr Paul Moore.odt retail2016
Mr Paul Moore.odt retail2016
 
Physics Tutor
Physics TutorPhysics Tutor
Physics Tutor
 
Cronograma de Evaluación
Cronograma de EvaluaciónCronograma de Evaluación
Cronograma de Evaluación
 
concetti elementari per la sicurezza
concetti elementari per la sicurezzaconcetti elementari per la sicurezza
concetti elementari per la sicurezza
 
Tharani Chellandy Resume
Tharani Chellandy ResumeTharani Chellandy Resume
Tharani Chellandy Resume
 
Ville et mobile : nouvelles pistes de services
Ville et mobile : nouvelles pistes de servicesVille et mobile : nouvelles pistes de services
Ville et mobile : nouvelles pistes de services
 
Management Agile & management 3.0
Management Agile & management 3.0Management Agile & management 3.0
Management Agile & management 3.0
 
Java session08
Java session08Java session08
Java session08
 
Arta conversatiei
Arta conversatieiArta conversatiei
Arta conversatiei
 
All about studio test
All about studio testAll about studio test
All about studio test
 
Portfolio_Mainak Dey
Portfolio_Mainak DeyPortfolio_Mainak Dey
Portfolio_Mainak Dey
 
10-etude des carffours
10-etude des carffours10-etude des carffours
10-etude des carffours
 
VKT.DinhHuuHanh
VKT.DinhHuuHanhVKT.DinhHuuHanh
VKT.DinhHuuHanh
 
The 3 e’s of customer experience
The 3 e’s of customer experienceThe 3 e’s of customer experience
The 3 e’s of customer experience
 
la prochaine marque dominante du tourisme air bnb
la prochaine marque dominante du tourisme air bnbla prochaine marque dominante du tourisme air bnb
la prochaine marque dominante du tourisme air bnb
 
RAVI RANA HOTEL MANAGEMENT PPT
RAVI RANA HOTEL MANAGEMENT PPTRAVI RANA HOTEL MANAGEMENT PPT
RAVI RANA HOTEL MANAGEMENT PPT
 
Le marché du logement neuf en Ile de France - 3ème trimestre 2015
Le marché du logement neuf en Ile de France - 3ème trimestre 2015Le marché du logement neuf en Ile de France - 3ème trimestre 2015
Le marché du logement neuf en Ile de France - 3ème trimestre 2015
 

Similar to Ajs 2 b

Ajs 1 a
Ajs 1 aAjs 1 a
Ajs 1 a
Niit Care
 
Dacj 1-1 c
Dacj 1-1 cDacj 1-1 c
Dacj 1-1 c
Niit Care
 
Vb.net session 03
Vb.net session 03Vb.net session 03
Vb.net session 03
Niit Care
 
UNIT IV DESIGN PATTERNS.pptx
UNIT IV DESIGN PATTERNS.pptxUNIT IV DESIGN PATTERNS.pptx
UNIT IV DESIGN PATTERNS.pptx
anguraju1
 
SADP PPTs of all modules - Shanthi D.L.pdf
SADP PPTs of all modules - Shanthi D.L.pdfSADP PPTs of all modules - Shanthi D.L.pdf
SADP PPTs of all modules - Shanthi D.L.pdf
B.T.L.I.T
 
Design patterns tutorials
Design patterns tutorialsDesign patterns tutorials
Design patterns tutorials
University of Technology
 
Sofwear deasign and need of design pattern
Sofwear deasign and need of design patternSofwear deasign and need of design pattern
Sofwear deasign and need of design pattern
chetankane
 
Architectural design
Architectural designArchitectural design
Architectural design
SHREEHARI WADAWADAGI
 
kuyper_instructionalscience29
kuyper_instructionalscience29kuyper_instructionalscience29
kuyper_instructionalscience29
Michiel Kuijper
 
1 IA Swinburne Faculty of Engineering, Science and Techn.docx
1 IA Swinburne Faculty of Engineering, Science and Techn.docx1 IA Swinburne Faculty of Engineering, Science and Techn.docx
1 IA Swinburne Faculty of Engineering, Science and Techn.docx
jeremylockett77
 
Design Concepts in Software Engineering-1.pptx
Design Concepts in Software Engineering-1.pptxDesign Concepts in Software Engineering-1.pptx
Design Concepts in Software Engineering-1.pptx
KarthigaiSelviS3
 
Software Architecture by Reuse, Composition and Customization
Software Architecture by Reuse, Composition and Customization  Software Architecture by Reuse, Composition and Customization
Software Architecture by Reuse, Composition and Customization
Ivano Malavolta
 
Vb.net session 13
Vb.net session 13Vb.net session 13
Vb.net session 13
Niit Care
 
NGIoT Sustainability Workshop 2023_ Hans-Martin Heyn presentation
NGIoT Sustainability Workshop 2023_ Hans-Martin Heyn presentationNGIoT Sustainability Workshop 2023_ Hans-Martin Heyn presentation
NGIoT Sustainability Workshop 2023_ Hans-Martin Heyn presentation
VEDLIoT Project
 
unit 3 Design 1
unit 3 Design 1unit 3 Design 1
unit 3 Design 1
TharuniDiddekunta
 
Ch08lect2 ud
Ch08lect2 udCh08lect2 ud
Ch08lect2 ud
Ahmet Balkan
 
Cs 1023 lec 8 design pattern (week 2)
Cs 1023 lec 8 design pattern (week 2)Cs 1023 lec 8 design pattern (week 2)
Cs 1023 lec 8 design pattern (week 2)
stanbridge
 
Design Patterns - General Introduction
Design Patterns - General IntroductionDesign Patterns - General Introduction
Design Patterns - General Introduction
Asma CHERIF
 
Csqe sample exam 1 solutions 05.00.04
Csqe sample exam 1   solutions 05.00.04Csqe sample exam 1   solutions 05.00.04
Csqe sample exam 1 solutions 05.00.04
binodrit98
 
Chapter 1 - Software Design - Introduction.pptx
Chapter 1 - Software Design - Introduction.pptxChapter 1 - Software Design - Introduction.pptx
Chapter 1 - Software Design - Introduction.pptx
HaifaMohd3
 

Similar to Ajs 2 b (20)

Ajs 1 a
Ajs 1 aAjs 1 a
Ajs 1 a
 
Dacj 1-1 c
Dacj 1-1 cDacj 1-1 c
Dacj 1-1 c
 
Vb.net session 03
Vb.net session 03Vb.net session 03
Vb.net session 03
 
UNIT IV DESIGN PATTERNS.pptx
UNIT IV DESIGN PATTERNS.pptxUNIT IV DESIGN PATTERNS.pptx
UNIT IV DESIGN PATTERNS.pptx
 
SADP PPTs of all modules - Shanthi D.L.pdf
SADP PPTs of all modules - Shanthi D.L.pdfSADP PPTs of all modules - Shanthi D.L.pdf
SADP PPTs of all modules - Shanthi D.L.pdf
 
Design patterns tutorials
Design patterns tutorialsDesign patterns tutorials
Design patterns tutorials
 
Sofwear deasign and need of design pattern
Sofwear deasign and need of design patternSofwear deasign and need of design pattern
Sofwear deasign and need of design pattern
 
Architectural design
Architectural designArchitectural design
Architectural design
 
kuyper_instructionalscience29
kuyper_instructionalscience29kuyper_instructionalscience29
kuyper_instructionalscience29
 
1 IA Swinburne Faculty of Engineering, Science and Techn.docx
1 IA Swinburne Faculty of Engineering, Science and Techn.docx1 IA Swinburne Faculty of Engineering, Science and Techn.docx
1 IA Swinburne Faculty of Engineering, Science and Techn.docx
 
Design Concepts in Software Engineering-1.pptx
Design Concepts in Software Engineering-1.pptxDesign Concepts in Software Engineering-1.pptx
Design Concepts in Software Engineering-1.pptx
 
Software Architecture by Reuse, Composition and Customization
Software Architecture by Reuse, Composition and Customization  Software Architecture by Reuse, Composition and Customization
Software Architecture by Reuse, Composition and Customization
 
Vb.net session 13
Vb.net session 13Vb.net session 13
Vb.net session 13
 
NGIoT Sustainability Workshop 2023_ Hans-Martin Heyn presentation
NGIoT Sustainability Workshop 2023_ Hans-Martin Heyn presentationNGIoT Sustainability Workshop 2023_ Hans-Martin Heyn presentation
NGIoT Sustainability Workshop 2023_ Hans-Martin Heyn presentation
 
unit 3 Design 1
unit 3 Design 1unit 3 Design 1
unit 3 Design 1
 
Ch08lect2 ud
Ch08lect2 udCh08lect2 ud
Ch08lect2 ud
 
Cs 1023 lec 8 design pattern (week 2)
Cs 1023 lec 8 design pattern (week 2)Cs 1023 lec 8 design pattern (week 2)
Cs 1023 lec 8 design pattern (week 2)
 
Design Patterns - General Introduction
Design Patterns - General IntroductionDesign Patterns - General Introduction
Design Patterns - General Introduction
 
Csqe sample exam 1 solutions 05.00.04
Csqe sample exam 1   solutions 05.00.04Csqe sample exam 1   solutions 05.00.04
Csqe sample exam 1 solutions 05.00.04
 
Chapter 1 - Software Design - Introduction.pptx
Chapter 1 - Software Design - Introduction.pptxChapter 1 - Software Design - Introduction.pptx
Chapter 1 - Software Design - Introduction.pptx
 

More from Niit Care

Ajs 4 c
Ajs 4 cAjs 4 c
Ajs 4 c
Niit Care
 
Ajs 1 c
Ajs 1 cAjs 1 c
Ajs 1 c
Niit Care
 
Dacj 4 2-c
Dacj 4 2-cDacj 4 2-c
Dacj 4 2-c
Niit Care
 
Dacj 4 2-b
Dacj 4 2-bDacj 4 2-b
Dacj 4 2-b
Niit Care
 
Dacj 4 2-a
Dacj 4 2-aDacj 4 2-a
Dacj 4 2-a
Niit Care
 
Dacj 4 1-c
Dacj 4 1-cDacj 4 1-c
Dacj 4 1-c
Niit Care
 
Dacj 4 1-b
Dacj 4 1-bDacj 4 1-b
Dacj 4 1-b
Niit Care
 
Dacj 1-3 b
Dacj 1-3 bDacj 1-3 b
Dacj 1-3 b
Niit Care
 
Dacj 1-3 a
Dacj 1-3 aDacj 1-3 a
Dacj 1-3 a
Niit Care
 
Dacj 1-2 c
Dacj 1-2 cDacj 1-2 c
Dacj 1-2 c
Niit Care
 
Dacj 1-2 a
Dacj 1-2 aDacj 1-2 a
Dacj 1-2 a
Niit Care
 
Dacj 1-1 b
Dacj 1-1 bDacj 1-1 b
Dacj 1-1 b
Niit Care
 
Dacj 1-1 a
Dacj 1-1 aDacj 1-1 a
Dacj 1-1 a
Niit Care
 
Dacj 2-2 b
Dacj 2-2 bDacj 2-2 b
Dacj 2-2 b
Niit Care
 
Dacj 2-2 a
Dacj 2-2 aDacj 2-2 a
Dacj 2-2 a
Niit Care
 
Dacj 2-1 c
Dacj 2-1 cDacj 2-1 c
Dacj 2-1 c
Niit Care
 
Dacj 2-1 b
Dacj 2-1 bDacj 2-1 b
Dacj 2-1 b
Niit Care
 

More from Niit Care (17)

Ajs 4 c
Ajs 4 cAjs 4 c
Ajs 4 c
 
Ajs 1 c
Ajs 1 cAjs 1 c
Ajs 1 c
 
Dacj 4 2-c
Dacj 4 2-cDacj 4 2-c
Dacj 4 2-c
 
Dacj 4 2-b
Dacj 4 2-bDacj 4 2-b
Dacj 4 2-b
 
Dacj 4 2-a
Dacj 4 2-aDacj 4 2-a
Dacj 4 2-a
 
Dacj 4 1-c
Dacj 4 1-cDacj 4 1-c
Dacj 4 1-c
 
Dacj 4 1-b
Dacj 4 1-bDacj 4 1-b
Dacj 4 1-b
 
Dacj 1-3 b
Dacj 1-3 bDacj 1-3 b
Dacj 1-3 b
 
Dacj 1-3 a
Dacj 1-3 aDacj 1-3 a
Dacj 1-3 a
 
Dacj 1-2 c
Dacj 1-2 cDacj 1-2 c
Dacj 1-2 c
 
Dacj 1-2 a
Dacj 1-2 aDacj 1-2 a
Dacj 1-2 a
 
Dacj 1-1 b
Dacj 1-1 bDacj 1-1 b
Dacj 1-1 b
 
Dacj 1-1 a
Dacj 1-1 aDacj 1-1 a
Dacj 1-1 a
 
Dacj 2-2 b
Dacj 2-2 bDacj 2-2 b
Dacj 2-2 b
 
Dacj 2-2 a
Dacj 2-2 aDacj 2-2 a
Dacj 2-2 a
 
Dacj 2-1 c
Dacj 2-1 cDacj 2-1 c
Dacj 2-1 c
 
Dacj 2-1 b
Dacj 2-1 bDacj 2-1 b
Dacj 2-1 b
 

Recently uploaded

How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
Miro Wengner
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
alexjohnson7307
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
saastr
 
SAP S/4 HANA sourcing and procurement to Public cloud
SAP S/4 HANA sourcing and procurement to Public cloudSAP S/4 HANA sourcing and procurement to Public cloud
SAP S/4 HANA sourcing and procurement to Public cloud
maazsz111
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
Hiike
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
HarisZaheer8
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
AstuteBusiness
 
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
Data Hops
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
ScyllaDB
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
Javier Junquera
 

Recently uploaded (20)

How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
 
SAP S/4 HANA sourcing and procurement to Public cloud
SAP S/4 HANA sourcing and procurement to Public cloudSAP S/4 HANA sourcing and procurement to Public cloud
SAP S/4 HANA sourcing and procurement to Public cloud
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
 
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
 

Ajs 2 b

  • 1. More on Design Patterns Pre-assessment Questions 2. Which UML diagram depicts the sequential invocation of methods of a system? a) Sequence b) Collaboration c) Package d) Use Case ©NIIT Architecting J2EE Solutions Lesson 2B / Slide 1 of 35
  • 2. More on Design Patterns Pre-assessment Questions 2. Which option identifies the scope of a system in a Use Case diagram and is represented by a solid rectangle? a) Use Case b) Message c) Actor d) State boundary ©NIIT Architecting J2EE Solutions Lesson 2B / Slide 2 of 35
  • 3. More on Design Patterns Pre-assessment Questions 2. Consider the statements: Statement A: Extent relationship indicates that an existing use case is extended by additional behavior to obtain another use case. Statement B: Include relationship indicates that the functions of one use case are included in the functions of the other. Identify the correct option. a) Statement A is true and statement B is false b) Statement A is false and statement B is true c) Both, statements A and B, are true d) Both, statements A and B, are false ©NIIT Architecting J2EE Solutions Lesson 2B / Slide 3 of 35
  • 4. More on Design Patterns Pre-assessment Questions 2. Consider the statements: Statement A: Component diagram represents the grouping of related classes, interfaces, and methods of a given system. Statement B: Component diagram elements represent the various components of business entities of a given system. Identify the correct option. a) Statement A is true and statement B is false b) Statement A is false and statement B is true c) Both, statements A and B, are true d) Both, statements A and B, are false ©NIIT Architecting J2EE Solutions Lesson 2B / Slide 4 of 35
  • 5. More on Design Patterns Pre-assessment Questions 2. Which element of GoF’s design pattern emphasizes on relationships, responsibilities, and collaborations among the constituents of a pattern? a) Pattern name b) Solution c) Problem d) Consequences ©NIIT Architecting J2EE Solutions Lesson 2B / Slide 5 of 35
  • 6. More on Design Patterns Solutions to Pre-assessment Questions 1. a. Sequence 2. d. State boundary 3. c. Both, statements A and B, are true 4. b. Statement A is false and statement B is true 5. b. Solution ©NIIT Architecting J2EE Solutions Lesson 2B / Slide 6 of 35
  • 7. More on Design Patterns Objectives In this lesson you will learn to: • Use Structural Design Patterns • Use Behavioral Design Patterns ©NIIT Architecting J2EE Solutions Lesson 2B / Slide 7 of 35
  • 8. More on Design Patterns Structural Design Patterns • Structural design patterns • Represent the composition of classes and objects. • Defines how classes inherit each other. • The class-creation pattern uses inheritance in order to provide more functional program interfaces. • The object-creation pattern defines how objects can be composed to provide new functionality using object composition. • The various structural design patterns are Adaptor, Bridge, Composite, Decorator, Façade, Flyweight, and Proxy. ©NIIT Architecting J2EE Solutions Lesson 2B / Slide 8 of 35
  • 9. More on Design Patterns Structural Design Patterns (Contd.) • Adapter Pattern • The Adapter design pattern • Converts the interface of a class into an interface that is required by the client. • The advantages of using Adapter design pattern are: • Enabling two or more incompatible objects to interact with each other. • Making an existing functionality reusable. • The participants of Adapter design pattern are: • adapterTest : Implements the methods of MouseAdapter class. • MouseListener: Receives the mouse events generated. • MouseAdapter: Provides blank implementation of the methods defined in the MouseListener abstract class. ©NIIT Architecting J2EE Solutions Lesson 2B / Slide 9 of 35
  • 10. More on Design Patterns Structural Design Patterns (Contd.) • Class diagram of the Adapter design pattern ©NIIT Architecting J2EE Solutions Lesson 2B / Slide 10 of 35
  • 11. More on Design Patterns Structural Design Patterns (Contd.) • Bridge Pattern • The Bridge design pattern • Separates an interface and its implementation. This enables both the interface and its interface to change without affecting each other. • Uses encapsulation, aggregation, and inheritance to divide responsibilities into various classes. • The advantages of using Bridge design pattern are: • Separates the implementation details from interface. • Hides implementation details from the client. ©NIIT Architecting J2EE Solutions Lesson 2B / Slide 11 of 35
  • 12. More on Design Patterns Structural Design Patterns (Contd.) • The participants of Bridge design pattern are: • ClientApp: Invokes the methods of ConcreteImplementor1 and ConcreteImplementor2 class. • Abstraction: Defines the methods that are implemented by ConcreteImplementor1 and ConcreteImplementor2 classes. • RefinedAbstraction: Extends the methods defined by class, Abstraction. • Implementor: Extends the methods of the Abstraction class to the implementation classes, ConcreteImplementor1 and ConcreteImplementor2. • ConcreteImplementor1: Implements the methods defined in the abstract class, Implementor. • ConcreteImplementor2: Implements the methods defined in the abstract class, Implementor. ©NIIT Architecting J2EE Solutions Lesson 2B / Slide 12 of 35
  • 13. More on Design Patterns Structural Design Patterns (Contd.) • Class diagram of the Bridge design pattern ©NIIT Architecting J2EE Solutions Lesson 2B / Slide 13 of 35
  • 14. More on Design Patterns Structural Design Patterns (Contd.) • Composite Pattern • The Composite design pattern • Composes objects into tree structures. • Enables a client to identically treat both the single component and collection of components. • The advantages of Composite design pattern are: • Adds new components. • Describes the hierarchies of a class, which consists of primitive and complex objects. ©NIIT Architecting J2EE Solutions Lesson 2B / Slide 14 of 35
  • 15. More on Design Patterns Structural Design Patterns (Contd.) • The participants of Composite design pattern are: • ClientClass: Invokes methods of an object through Component interface. • Component: Declares interface for accessing and managing its child components. • Leaf: Defines an object in composition, which has no children. • Composite: Defines behavior for parent components and stores child components. ©NIIT Architecting J2EE Solutions Lesson 2B / Slide 15 of 35
  • 16. More on Design Patterns Structural Design Patterns (Contd.) • Class diagram of the Composite design pattern ©NIIT Architecting J2EE Solutions Lesson 2B / Slide 16 of 35
  • 17. More on Design Patterns Structural Design Patterns (Contd.) • Decorator Pattern • The Decorator design pattern • Enables you to extend the functionality of a particular object of a class and dynamically provide additional responsibilities to it. • Uses composition instead of inheritance in order to extend the functionality, the Decorator design pattern. • The advantages of using Decorator design pattern are: • It makes it easy to code a behavior, by enabling you to create functionality classes. • It is more flexible as compared to static inheritance. • It improves the extensibility of an object as you code new classes to make a change in functionality. ©NIIT Architecting J2EE Solutions Lesson 2B / Slide 17 of 35
  • 18. More on Design Patterns Structural Design Patterns (Contd.) • The participants of Decorator design pattern are: • Component: Describes the functionality that the client requires. • ConcreteComponent: Implements the functionality described in the abstract class, Component and represents the object to which you can add additional functionalities. • Decorator: Enables ConcreteDecorator1 and ConcreteDecorator2 to implement the functionality of the abstract class, Component. • ConcreteDecorator1: Implements the functionality of the abstract class, Component through the abstract class, Decorator. • ConcreteDecorator2: Implements the functionality of the abstract class, Component through the abstract class, Decorator. ©NIIT Architecting J2EE Solutions Lesson 2B / Slide 18 of 35
  • 19. More on Design Patterns Structural Design Patterns (Contd.) • Class diagram of the Decorator design pattern ©NIIT Architecting J2EE Solutions Lesson 2B / Slide 19 of 35
  • 20. More on Design Patterns Structural Design Patterns (Contd.) • Facade Pattern • The Façade design pattern • Provides a unified interface to a collection of interfaces in a subsystem. • The advantages of using Façade design pattern are: • Simplifies the interfacing that makes it difficult to use a large amount of coupling. • Protects the client from the complex subsystem components. • The Façade design pattern has two participants: • Façade: Is also a participant of a system that intercepts client requests and dispatches the request to the subsystem to service the client request. • SubSystemN: Defines an application, which uses a façade to interact with the client. There can be multiple subsystems in an application, such as SubSystem1, SubSystem2, …, SubSystemN. ©NIIT Architecting J2EE Solutions Lesson 2B / Slide 20 of 35
  • 21. More on Design Patterns Structural Design Patterns (Contd.) • Class diagram of the Façade design pattern ©NIIT Architecting J2EE Solutions Lesson 2B / Slide 21 of 35
  • 22. More on Design Patterns Structural Design Patterns (Contd.) • Flyweight Pattern • The Flyweight design pattern is used to efficiently share information between a large numbers of objects. • Several objects may exist in a system, each using some information and thereby consuming a large amount of memory. • If all the objects share some static information, you can remove that information from each object and place in one object. • All other objects can refer to this object, thus reducing the memory requirement of the system. • The object, which contains the common information that is referenced by other objects, is known as the flyweight object. ©NIIT Architecting J2EE Solutions Lesson 2B / Slide 22 of 35
  • 23. More on Design Patterns Structural Design Patterns (Contd.) • The advantages of using Flyweight design pattern are: • Enabling large amount objects to share information. • Making optimum use of memory. • The participants of Flyweight design pattern are: • FlyweightFactory: Creates the flyweight objects. • Flyweight: Declares an interface to enable the flyweights to interact with the abstract state. • ClientApp: Invokes the methods of FlyweightFactory class. • ConcreteFlyweight: Implements the functionality of the abstract class, Flyweight. ©NIIT Architecting J2EE Solutions Lesson 2B / Slide 23 of 35
  • 24. More on Design Patterns Structural Design Patterns (Contd.) • Class diagram of the Flyweight design pattern ©NIIT Architecting J2EE Solutions Lesson 2B / Slide 24 of 35
  • 25. More on Design Patterns Structural Design Patterns (Contd.) • Proxy Pattern • The Proxy design pattern enables you to provide a stand-in object in place of another object. • The stand-in object receives the requests that are meant for the original object and delegates the requests to the original object. • The examples of proxy are remote and virtual. • A remote proxy object provides a local representation of an object that runs in a different address space. ©NIIT Architecting J2EE Solutions Lesson 2B / Slide 25 of 35
  • 26. More on Design Patterns Structural Design Patterns (Contd.) • The advantages of using Proxy design pattern are: • A remote proxy provides location transparency to the client of object. • A virtual proxy provides memory optimization be creating objects when required. • The participants of Proxy design pattern are: • ClientProgram: Invokes the methods on a remote object. • InterfaceMatter: Declares the methods, which are implemented by the Matter class. • Matter: An object that provides services to its clients. • Proxy: An object that intercepts the requests and delegates them to the original object. ©NIIT Architecting J2EE Solutions Lesson 2B / Slide 26 of 35
  • 27. More on Design Patterns Structural Design Patterns (Contd.) • Class diagram of the Proxy design pattern ©NIIT Architecting J2EE Solutions Lesson 2B / Slide 27 of 35
  • 28. More on Design Patterns Identifying Structural Design Patterns • Problem Statement • BlueMoon Inc. provides software consultancy services. The company foresees a high demand for the retail automation software. As a result, BlueMoon Inc. decides to develop Retailer Automation Solution (RAS), which provides the functions to update the inventory, automate the sales record, and reduce the transaction-processing time. RAS needs to be developed in a way that it can be modified according to the specific requirements of each retailer. For this reason, BlueMoon Inc. ensures that RAS is extensible and adaptable, which enables BlueMoon Inc. to reuse the components of the RAS to create customized solutions for different retailers. John, the software consultant at BlueMoon Inc. decides to model the structural diagram and identify the various structural design patterns, which will enable him to reuse the existing components. ©NIIT Architecting J2EE Solutions Lesson 2B / Slide 28 of 35
  • 29. More on Design Patterns Identifying Structural Design Patterns (Contd.) • Solution • To solve the preceding problem, perform the following tasks: • Draw the structural diagram of the application. • Identify the Decorator design pattern. • Identify the Proxy design pattern. • Identify the Bridge design pattern. • Identify the Facade design pattern. ©NIIT Architecting J2EE Solutions Lesson 2B / Slide 29 of 35
  • 30. More on Design Patterns Behavioral Design Patterns • The Behavioral design pattern • Defines the state, behavior, and communication among the objects. • Various Behavioral design patterns are Chain of Responsibility, Command, Interpreter, Iterator, Mediator, Memento, Observer, State, Strategy, Template Method, and Visitor. • Chain of Responsibility Pattern • Chain of Responsibility design pattern • Decouples the sender and receiver of a request by introducing a number of objects between them. • The advantages of using Chain of Responsibility design pattern are: • Enabling a group of classes to act as a single class. • Providing flexibility while dividing responsibilities among the objects. ©NIIT Architecting J2EE Solutions Lesson 2B / Slide 30 of 35
  • 31. More on Design Patterns Behavioral Design Patterns (Contd.) • Class diagram of the Chain of Responsibility design pattern ©NIIT Architecting J2EE Solutions Lesson 2B / Slide 31 of 35
  • 32. More on Design Patterns Behavioral Design Patterns (Contd.) • Command Pattern • The Command design pattern • Encapsulates a request as an object and enables the queuing and logging of requests. • Supports undo operations. • The advantages of using Command design pattern are: • Enables you to execute the commands whenever the resources are available. • Enables you to add new commands, as the existing classes do not change. ©NIIT Architecting J2EE Solutions Lesson 2B / Slide 32 of 35
  • 33. More on Design Patterns Behavioral Design Patterns (Contd.) • Class diagram of the Command design pattern ©NIIT Architecting J2EE Solutions Lesson 2B / Slide 33 of 35
  • 34. More on Design Patterns Summary • Structural design patterns that describe the composition of the classes and objects. This design pattern introduces a level of indirection between a client class and the class that the client wants to use. The various structural design patterns are: • Adapter: Enables classes of different interfaces work together in a single program. • Bridge: Separates an interface from its implementation so that either can be changed without affecting each other. • Composite: Enables a client to identically treat both the single component and collection of components. • Decorator: Enables you to extend the functionality of a particular object and dynamically provide additional responsibilities to it. • Façade: provides a unified interface to a collection of interfaces in a subsystem. • Flyweight: Enable you to share information among a number of objects. • Proxy: Enables you to provide a stand-in object in place of another object. ©NIIT Architecting J2EE Solutions Lesson 2B / Slide 34 of 35
  • 35. More on Design Patterns Summary(Contd.) • Behavioral design patterns that describe the behavior of an object. The various Behavioral design patterns are Chain of Responsibility, Command, Interpreter, Iterator, Mediator, Memento, Observer, State, Strategy, Template Method, and Visitor. • Chain of Responsibility: Defines a number of classes can handle a request without knowing the capabilities of other classes. • Command: Dispatches a request to a specific application. ©NIIT Architecting J2EE Solutions Lesson 2B / Slide 35 of 35