Professional Documents
Culture Documents
SUBMITTED BY :- YOGESHWARA S
A very common feeling while writing code is that of déjà vu. It’s the
uncanny sensation that you’ve come across this code before! At some
point, while writing an application, you’ll need to implement some
business logic that you’ve previously used. This is inevitable as a project
scales, and it’s a problem that crops up in large codebases. The remedy to
this common dilemma is the DRY (Don’t Repeat Yourself) principle.
What Is DRY?
Now that you know why duplication happens, what can you do about it?
Abstractions
This is commonly the case for designing classes. When multiple classes
share some common business logic, we simply abstract the logic into a
superclass, which each class then inherits. Standard object-oriented
programming (OOP) has many practices that encourage the DRY
principle for writing readable, reusable, and maintainable code.
Furthermore, there are alternatives like composition that solve the
limitations of using inheritance and give programmers more flexibility.
Automation
This is the case for project awareness of developers. Teams should
be cross-functional to ensure active communication between developers.
Managers should encourage such communication so developers never
end up repeating completed work and can discuss their mutual
problems.
Normalization
Instead, extract the duplicates into a separate entity. The source then
references this entity. Edgar Codd proposed this concept as part of his
model of relational databases.
How Plutora Implements DRY
While you’re developing software, an important step is to correctly
evaluate the value stream of the entire process—the steps in software
development that create customer value. Awareness of the value stream
helps managers optimize workflows by eliminating waste such as delays
or reworks.
Furthermore, Plutora also breaks down operational silos by connecting
diverse teams and their processes. To do this, the system uses real-time
metrics from multiple platforms by integrating with existing tools and
workflows. This creates a single source of truth for the entire software
development life cycle! This process requires proper normalization and
extraction of different representations of data across multiple teams.
Plutora’s value stream flow metrics (VSFM) dashboard not only
normalizes the data but also analyzes and displays it in a single, secure,
user-friendly platform. This means everyone in the organization has
access to the same information. Also, it gives managers visibility of all
pipelines from idea to production and complete control to make
necessary changes to optimize the process. To get a more comprehensive
overview of the power of VSFM, you can refer to this free guide. You can
also get a free, personalized demo of Plutora.
Overuse of DRY
Every line of code written doesn’t have to be unique. Developers
sometimes have a fear of rework and waste and perceive these as the
epitome of unproductive behavior. But the overuse of DRY actually stops
us from writing clean code.
Every principle needs to be applied depending on the context.
Sometimes code duplication suits the environment. Removing that
might introduce unnecessary upfront coupling or complexity into the
system. In such situations, living with a bit of duplication might not be
the worst thing.
Premature optimization is also a common issue with new developers. As
a general rule, developers should avoid applying generalizations to
functionality before it’s repeated. More real and immediate problems
take precedence, and it’s paramount that we solve those problems first.
DRY isn’t just a principle for storing data or writing code. It’s something
we can apply throughout each stage of our project. DRY is a tool that
helps us optimize our processes, collaboration, and products.