SOLIDify
This presentation is the property of its rightful owner.
Sponsored Links
1 / 25

SOLIDify Your Microsoft ASP.NET MVC Applications PowerPoint PPT Presentation


  • 42 Views
  • Uploaded on
  • Presentation posted in: General

SOLIDify Your Microsoft ASP.NET MVC Applications. Simon Laroche Architecte Logiciel PCMS Conseil [email protected] Risks of Poorly Designed Code. Difficult and Expensive to Maintain Buggy Speed of development degrades rapidly Longer and longer test cycles

Download Presentation

SOLIDify Your Microsoft ASP.NET MVC Applications

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Solidify your microsoft asp net mvc applications

SOLIDify Your MicrosoftASP.NET MVC Applications

Simon Laroche

ArchitecteLogiciel

PCMS Conseil

[email protected]


Risks of poorly designed code

Risks of Poorly Designed Code

  • Difficult and Expensive to Maintain

  • Buggy

  • Speed of development degrades rapidly

  • Longer and longer test cycles

  • A BIG BALL OF MUD is a casually, even haphazardly, structured system. Its organization, if one can call it that, is dictated more by expediency than design.http://www.laputan.org/mud/http://en.wikipedia.org/wiki/Big_ball_of_mud


What is asp net mvc

What is ASP.NET MVC?

  • Model

    • The representation of the business rules and data

  • View

    • The representation of a single UI component (a form or page, typically)

  • Controller

    • Maintains the logic of which View to display, and what data the view needs.


Solidify your microsoft asp net mvc applications

MVC

ASP.NET Runtime

Model

Controller

1

Request

2

3

4

View

Response


Solidify your microsoft asp net mvc applications

A Simple ASP.NET MVC Application


Benefits of oop

Benefits of OOP

  • -ilities

    • Reliability

    • Extensibility

    • Maintainability

    • Flexibility

  • Management of Complexity


Solidify your microsoft asp net mvc applications

S O L I D Principles


Solid development principles

SOLID Development Principles

  • SRP – Single Responsibility Principle

  • OCP – Open / Closed Principle

  • LSP – Liskov Substitution Principle

  • ISP – Interface Segregation Principle

  • DIP – Dependency Inversion Principle


Srp what s a responsibility

SRP: What’s a Responsibility?

  • Persistence

  • Logging

  • Exception Handling

  • Formatting

  • Rendering / User Interface

  • “A class should have one, and only one, reason to change.”


Solidify your microsoft asp net mvc applications

SRP Violation


Ocp changes new code

OCP: Changes = New Code

  • “Modules should be open for extension, but closed for modification.”

  • Adding features should be handled by adding new code, not changing existing code.


Solidify your microsoft asp net mvc applications

OCP Violation


Lsp subclasses extend not remove

LSP: Subclasses Extend, Not Remove

  • “Derived classes must be usable through the base class interface without the need for the user to know the difference”

  • Subclasses cannot remove functionality, or change expected behaviors, of classes from which they inherit


Solidify your microsoft asp net mvc applications

LSP Violation


Isp clients control interfaces

ISP: Clients Control Interfaces

  • “Separate interfaces so callers are only dependent on what they actually use”

  • Avoid “fat” interfaces

  • Tailor interfaces to clients

  • Consider packaging interface with client


Solidify your microsoft asp net mvc applications

ISP Violation


Dip depend on abstractions

DIP: Depend on Abstractions

  • “Inject” dependencies into classes

  • Infrastructure should depend on core domain classes, not the other way around

  • Classes should not decide particulars of how their collaborators’ work is done – separate concern


Dip depend on abstractions1

DIP: Depend on Abstractions


Dip depend on abstractions2

DIP: Depend on Abstractions


Solidify your microsoft asp net mvc applications

DIP Violation


Simple design rules

Simple Design Rules

  • Runs all the tests

  • Contains no duplication

  • Expresses the intent of the programmer

  • Minimizes the number of classes and methods

  • The rules are given in order of importance.

    Kent Beck, Extreme Programming Explained


Don t repeat yourself dry

Don’t Repeat Yourself (DRY)

  • "Every piece of knowledge must have a single, unambiguous, authoritative representation within a system."

  • Eliminating duplication is at the heart of many design patterns and OOP principles


Solidify your microsoft asp net mvc applications

Refactoring : Make It Right


Recommended books

Recommended Books

  • Agile Software Development

  • Agile Principles, Patterns, and Practices in C#

  • Clean Code

    All written by Robert C. “Uncle Bob” Martin

    Also see: http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod


  • Login