JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD

JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD B.Tech IV DESIGN PATTERNS Previous Question Paper (September - 2021 - R15)

B.Tech | IV | I | R15 | September - 2021

Answer PaperPaper Code: 127CFMaximum Marks: 75Time: 3 Hours

Answer any Five Questions. All Questions Carry Equal Marks.

Main

1

Draw a diagram to show relationships among design patterns? How to select a design pattern? How to use a design pattern?

15 marks

Answer

Design patterns are categorized by their purpose (Creational, Structural, Behavioral) and scope (Class, Object). The relationships among them are defined by how they interact to solve recurring software design problems. Creational patterns handle object creation, Structural patterns deal with object composition, and Behavioral patterns focus on communication between objects. For example, a Factory Method (Creational) might be used to create objects that are then organized by a Composite (Structural) pattern and controlled by an Observer (Behavioral) pattern.

To select a design pattern, follow these systematic steps:

  • Analyze the problem: Identify the specific design challenge, such as object creation complexity, class hierarchy issues, or communication decoupling.
  • Review the Intent: Consult the 'Intent' section of various patterns to see which ones address your specific problem.
  • Examine Consequences: Evaluate the trade-offs, such as memory usage, flexibility, and complexity, associated with each candidate pattern.
  • Consider Relationships: Look for patterns that are often used together or are alternatives to one another.
  • Prototype: Implement a small-scale version to verify if the pattern effectively solves the problem without introducing unnecessary overhead.

To use a design pattern effectively, follow this implementation process:

  • Understand the structure: Study the participants (classes and objects) and their collaborations as defined in the pattern's class diagram.
  • Identify participants: Map the abstract roles in the pattern to the concrete classes in your application.
  • Define interfaces: Establish the necessary interfaces or abstract classes to ensure loose coupling between components.
  • Implement the logic: Write the code for the specific pattern, ensuring that the interaction between classes adheres to the pattern's design principles.
  • Refactor: Integrate the pattern into the existing code base, refactoring where necessary to ensure the design remains clean and maintainable.
2

Explain the following with respect to LEXI's design:

15 marks
a

Establishing the user interface

7 marks

Answer

In the Lexi document editor, establishing the user interface involves creating a flexible structure that balances the needs of the document representation with the requirements of the display. Lexi uses a recursive composition pattern, where document elements like characters, rows, and columns are treated as Glyphs. This allows the interface to treat simple elements and complex compositions uniformly. The user interface is established by nesting these glyphs to form a hierarchical structure, enabling the system to manage complex layouts, such as wrapping text or inserting graphics, by simply manipulating the tree of glyphs. This design decouples the document's logical structure from its visual representation, allowing for dynamic updates to the interface as the document is edited.

b

Supporting multiple Window systems.

8 marks

Answer

Sign in to view the complete answer paper.

3

Discuss about creational patterns.

15 marks

Answer

Sign in to view the complete answer paper.

415 marks
a

Explain about sample code and uses of Bridge pattern.

8 marks

Answer

Sign in to view the complete answer paper.

b

Discuss about implementation and related patterns of Composite pattern.

7 marks

Answer

Sign in to view the complete answer paper.

5

Write and explain sample codes of Decorator and Flyweight patterns in detail.

15 marks

Answer

Sign in to view the complete answer paper.

6

Discuss in detail about Chain of Responsibility pattern.

15 marks

Answer

Sign in to view the complete answer paper.

7

Describe applicability, collaborations and sample code of Memento and Strategy.

15 marks

Answer

Sign in to view the complete answer paper.

8

Explain the following:

15 marks
a

Alexander's pattern languages

5 marks

Answer

Sign in to view the complete answer paper.

b

History of design patterns

5 marks

Answer

Sign in to view the complete answer paper.

c

A common design vocabulary.

5 marks

Answer

Sign in to view the complete answer paper.

About this paper

This page contains the solved question paper with answers of DESIGN PATTERNS from JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD for B.Tech CSE IV I, September - 2021, R15.

For the question paper without answers, switch to the Question Paper tab.

Other papers in DESIGN PATTERNS

Loading Question Papers

Fetching data from database...