You are on page 1of 4

2080 ASHWIN

1. Ans:
1st part:
Encapsulation:
Encapsulation is the mechanism of hiding of data implementation by restricting access to public
methods. Instance variables are kept private and accessor methods are made public to achieve
this.
Abstraction:
Abstract means a concept or an Idea which is not associated with any particular instance. Using
abstract class/Interface we express the intent of the class rather than the actual
implementation. In a way, one class should not know the inner details of another in order to use
it, just knowing the interfaces should be good enough.
Inheritance
Inheritances expresses “is-a” and/or “has-a” relationship between two objects. Using
Inheritance, In derived classes we can reuse the code of existing super classes. In Java, concept
of “is-a” is based on class inheritance (using extends) or interface implementation (using
implements).
Polymorphism
It means one name many forms. It is further of two types — static and dynamic. Static
polymorphism is achieved using method overloading and dynamic polymorphism using method
overriding. It is closely related to inheritance. We can write a code that works on the superclass,
and it will work with any subclass type as well.

2nd part:
• Immutability: Immutability is one of the main advantages of functional programming.
Data is immutable in functional programming, which implies that once a value has been
given to a variable, it cannot be modified. This aids in removing issues that may appear
as a result of data being accidentally altered in several locations. On the other hand,
object-oriented programming mainly relies on mutable state, which may result in errors
and unexpected behavior.
• Better concurrency: Because functional programming eliminates mutable state, which
can lead to race situations and other concurrency problems, it is a good fit for
concurrent programming. To handle concurrent access to mutable state, object-
oriented programming frequently uses locks and other synchronization techniques.
• Easier to reason about: Because functional programming avoids side effects and
changeable state, it is frequently simpler to reason about. This makes it simpler to
evaluate and comprehend a program’s behavior. In contrast, since objects may interact
in complicated ways and because changeable state might result in unanticipated
behavior, object-oriented programming can be more challenging to reason about.
• Composability: Pure functions, which are readily combined to create bigger functions,
are encouraged to be used in functional programming. As a result, it is simpler to
develop code that can be reused across several application components. In contrast,
inheritance and polymorphism are frequently used in object-oriented programming,
which can result in tightly connected, difficult-to-reuse code.
• Type safety: Strong type systems that may detect faults at compile time are frequently
found in functional programming languages, which can aid in the eradication of runtime
errors. In contrast, dynamic typing is frequently used in object-oriented programming
languages, which can result in problems that are difficult to detect at runtime.

2. Ans:
https://blog.visual-paradigm.com/what-are-the-six-types-of-relationships-in-uml-class-
diagrams/

3. Ans:
4. Ans:

5. Ans:

1st Part:
• Framework: A framework is a pre-existing set of tools, libraries, and code
structures that provide a basis for building software applications. Frameworks
provide a standardized way of building software, and they can speed up
development by providing pre-built functionality. A framework can be thought
of as a skeleton or a foundation that developers can build upon. Examples of
popular frameworks include Ruby on Rails, Django, and React.
• Design pattern: A design pattern is a reusable solution to a commonly occurring
problem in software design. Design patterns are usually at a lower level of
abstraction than frameworks, and they provide solutions to specific problems
that developers encounter when designing software. Design patterns are often
language-agnostic and can be applied to multiple programming languages.
Examples of design patterns include the Singleton pattern, the Factory pattern,
and the Observer pattern.
2nd part:
Design patterns offer numerous advantages in software development. They can
simplify the coding process, enhance code maintainability, and promote code
reuse. They also help developers write code that is more efficient, scalable, and
adaptable

3rd part:
• Creator
The Creator principle guides the allocation of responsibility for creating objects.
According to this principle, a class should be responsible for creating objects of
other classes if the first-class aggregates, contains, or has a composition
relationship with the second class. This principle promotes low coupling
between classes, enabling better maintainability and reusability.
• Controller
The Controller principle suggests that an entity responsible for handling a
system operation should be a separate class. Controllers act as intermediaries
between the user interface and the business logic, orchestrating the flow of
information and managing the interaction between objects. By encapsulating
the control logic in dedicated controller classes, we achieve better separation of
concerns and improve the overall flexibility of the system
• Polymorphism
Polymorphism is a fundamental principle in object-oriented design that enables
objects of different classes to be treated uniformly through a common interface.
By leveraging polymorphism, we can design systems that are extensible and
adaptable to new requirements. Polymorphic behavior allows for code reuse
and promotes loosely coupled systems.
6. Ans:

7. Ans:
a) Object Oriented Model:
The Object-Oriented Model organizes data and functionality around real-world entities like
objects. Imagine a car: its attributes (color, seats) and actions (drive, brake) are bundled
together. Classes define blueprints for similar objects (different colored cars). Inheritance lets
"special" objects (sports cars) inherit general car traits while adding unique ones (spoiler).
Encapsulation keeps internal details hidden, ensuring data integrity. This flexible, modular
approach promotes code reusability, easier maintenance, and a clearer reflection of real-world
complexity in software.
b) CRC card:
CRC cards, short for Class-Responsibility-Collaboration, are brainstorming tools used in object-
oriented design. Think of them as mini index cards divided into three sections: the class (e.g.,
"Book"), its responsibilities (e.g., "has title, author, publish date"), and collaborators (e.g.,
"Library" class to manage borrowing). By filling these out for different elements, teams can
collaboratively explore concepts, clarify object interactions, and ultimately design better
software. They're not just for beginners, even experienced developers find them handy for quick
prototyping and sparking creative solutions.
c) RUP phases:
RUP divides software development into 4 iterative phases: Inception focuses on feasibility and
initial requirements, crafting a business case and project vision. Elaboration builds on that,
refining requirements, architecture, and design with prototypes and risk assessments.
Construction brings it all to life, coding, testing, and integrating features. Finally, Transition
polishes the project, deploys it, trains users, and gathers feedback to ensure a smooth launch
and support. Remember, each phase overlaps and iterates, adapting to evolving needs and risks.
d) OOA to OOD:
OOA and OOD are like architects sketching a house (OOA) before drawing detailed blueprints
(OOD). In OOA, we identify real-world concepts as classes and their relationships. We don't
worry about implementation details. Once the foundation is laid, OOD dives deeper, defining
class attributes, methods, and interactions. We refine class structures, add inheritance and
polymorphism, and consider implementation concerns like performance and memory usage.
This transformation translates the broad strokes of OOA into a concrete design ready for coding
in an object-oriented programming language.

You might also like