JNTU
JNTU MCA 2018 DESIGN PATTERNS Previous Question Paper (June/July - 2018 - R13)
Note: This question paper contains two parts A and B. Part A is compulsory which carries 20 marks. Answer all questions in Part A. Part B consists of 5 Units. Answer any one full question from each unit.
Part A
Answer all questions. Each question carries 4 marks.
Discuss the significance of the design patterns.
Answer
Design patterns are significant because they provide proven, reusable solutions to recurring problems in software architecture. Their primary importance lies in the following areas:
- Standardized Vocabulary: They establish a common terminology for developers, facilitating clearer communication and reducing ambiguity during the design and development phases.
- Proven Solutions: By capturing the experience of expert designers, patterns offer well-tested approaches that prevent common pitfalls and ensure robust, maintainable code structures.
- Improved Maintainability: Patterns promote loose coupling and high cohesion, which makes systems easier to modify, extend, and refactor without introducing unintended side effects.
- Accelerated Development: By providing ready-made design templates, they allow developers to focus on the specific business logic of an application rather than reinventing fundamental architectural mechanisms.
Explain about the features and usage of builder pattern.
Answer
The Builder Pattern is a creational design pattern used to construct complex objects step-by-step. It separates the construction of a complex object from its representation, allowing the same construction process to create different representations.
Key features include:
- Encapsulation: It encapsulates the construction logic of a complex object, keeping the client code clean and focused on the final product.
- Step-by-step construction: It provides a fluent interface to configure the object incrementally, which is particularly useful when an object has many optional parameters.
- Immutability: It is often used to create immutable objects, as the object is only fully instantiated once the build process is complete.
Usage scenarios include:
- When an object requires a complex initialization process involving multiple steps or conditional logic.
- When a class has a large number of constructor parameters, avoiding the 'telescoping constructor' anti-pattern where many constructors are defined to handle different combinations of arguments.
- When the creation process must allow different representations of the constructed object, such as building different types of documents (e.g., PDF or HTML) using the same builder interface.
Write brief notes on proxy pattern.
Answer
Sign in to view the complete answer paper.
Compare Interator and Interpreter patterns.
Answer
Sign in to view the complete answer paper.
Write brief notes on strategy pattern.
Answer
Sign in to view the complete answer paper.
Part B
How to use a design pattern? Explain with a suitable example.
Answer
Sign in to view the complete answer paper.
Explain the catalog of design patterns.
Answer
Sign in to view the complete answer paper.
Discuss how design patterns can be used for designing a document editor.
Answer
Sign in to view the complete answer paper.
Explain about abstract factory and factory method patterns.
Answer
Sign in to view the complete answer paper.
Write the source code, implementation and uses of decorator pattern with a suitable example.
Answer
Sign in to view the complete answer paper.
Explain the usage of adapter and bridge patterns with a suitable example.
Answer
Sign in to view the complete answer paper.
Discuss the implementation of chain of responsibility pattern and explain its usage with suitable example.
Answer
Sign in to view the complete answer paper.
Discuss in detail about mediator and memento patterns.
Answer
Sign in to view the complete answer paper.
What are the considerations and expectations from design patterns? Discuss about visitor pattern.
Answer
Sign in to view the complete answer paper.
Discuss about pattern community. Explain about template method pattern.
Answer
Sign in to view the complete answer paper.