A SOLID Grasp of C# Design: Principles, Refactoring, and a Case-Driven Approach
Loading...
Date
Authors
Journal Title
Journal ISSN
Volume Title
Publisher
Πανεπιστήμιο Πελοποννήσου
Abstract
The thesis investigates how the combined application of the SOLID principles and the GRASP patterns can be used to produce robust C# software designs that remain maintainable, testable, and extensible as systems evolve. A unified, principle-to-practice framework is presented in which SOLID secures class- and component-level integrity while GRASP structures responsibilities and collaborations at the architectural level. The approach is operationalized in the .NET ecosystem through idiomatic refactorings—interface extraction, role-focused interface segregation, strategy-based composition, and dependency inversion realized via dependency injection—so that variation can be absorbed at stable seams owned by high-level policy. To move beyond stylistic guidance, the work employs metric-guided evaluation and a cohesive C# case study representative of an e-commerce workflow. Changes are validated using static and change-based indicators (coupling/cohesion proxies, instability indices, files-touched per feature), along with test metrics (coverage and mutation score). The results indicate that dependency boundaries defined and verified at the policy layer localize change, reduce “shotgun surgery,” and enable faster, more reliable testing through mocks and contract tests; extension by addition is favored over risky edits, and architectural refactoring becomes safer. Contributions include: (i) a mapped correspondence between SOLID and GRASP that clarifies when and how to apply each; (ii) a refactoring playbook tied to expected metric movement; (iii) case studies demonstrating end-to-end impact in C#; and (iv) pedagogical scaffolding suitable for studio-style instruction. Limitations are noted regarding external validity across real-time or resource-constrained domains and the use of proxy metrics for maintainability. Future work is outlined for principle-aware analyzers, boundary verification in continuous integration, broader multi-team replication, and curriculum-ready case libraries, with the aim of turning design principles into repeatable, measurable engineering practice.
Description
Μ.Δ.Ε. 91
Keywords
Λογισμικό υπολογιστών-Ανάπτυξη, Γλώσσες προγραμματισμού (Ηλεκτρονικοί Υπολογιστές), Αντικειμενοστρεφής προγραμματισμός (Ηλεκτρονικοί Υπολογιστές), Ανακατασκευή λογισμικού, C# (Γλώσσα προγράμματος υπολογιστή), Computer software-Development, Programming Languages (Electronic computers), Object-oriented programming (Computer science), Software refactoring, C# (Computer program language)
