Implementation
Implementation
July, 2024
Chapter 5 Outline
Implementation/Build/Coding
01 Implementation language and platform
issues
02 Pair Programming
03 Refactoring
04 Design Patterns
Advantages Challenges
Improved Code Quality Increased Cost
Knowledge Sharing Personality Conflicts
Enhanced Collaboration Coordination and Synchronization
Faster Problem Solving Skill Disparities
Increased Focus Scheduling and availability
Objectives of Refactoring
Identify Code Smells: Look for signs in the code that indicate potential problems,
such as large methods, duplicated code, complex conditional logic, or overly
coupled classes. These "code smells" can be a good starting point for refactoring.
Improve Code Readability: Making the code easier to read and understand.
Best practices
Refactor in Small Steps, Test Frequently
Use Version Control: Keep track of changes and be able to revert to
previous versions if necessary.
Maintain Readability
Document Changes
Improved Code Reuse: Design patterns capture best practices and proven
solutions to recurring problems, allowing developers to reuse code and avoid
reinventing the wheel.
Enhanced Flexibility and Extensibility: Many design patterns, such as the
Strategy, Observer, and Decorator patterns, make it easier to modify the behavior
of a system without extensive changes to the codebase.
Clearer Communication: Design patterns provide a common vocabulary for
describing and discussing software architecture, making it easier for developers
to collaborate and understand each other's code.
Reduced Complexity: By providing well-established solutions to common
problems, design patterns can help manage the complexity of large, enterprise-
level software systems.
Compiled by : Biniam Behailu & Yimer Amedie Introduction to Software Engineering 18
Design patterns (Benefits)
A set of standards and best practices that developers follow to ensure their code
is consistent, readable, maintainable, and free from common errors.
Adhering to coding guidelines helps improve the quality and reliability of the
software.
Best Practices
DRY Principle: Don’t Repeat Yourself. Reuse code wherever possible to avoid
duplication.
KISS Principle: Keep It Simple, Stupid. Write simple and straightforward code.
YAGNI Principle: You Ain’t Gonna Need It. Avoid adding functionality until it is
necessary
Key areas
Naming conventions: proper name for functions, class, variables, constants and
global variables.
Code formatting:
Code Structure
o Functions and Methods: Keep functions and methods short and focused on a single
task.
o Classes: Organize related functions and data into classes, adhering to the principles of
object-oriented design.
o Modules: Group related classes and functions into modules for better organization and
reusability.
Error Handling
o Exceptions: Use exceptions for error handling and ensure they provide meaningful
error messages.
o Logging: Implement logging to capture error conditions and significant events.