+ All Categories
Home > Software > AntiPatterns: Avoiding the Traps of Bad Design

AntiPatterns: Avoiding the Traps of Bad Design

Date post: 16-Apr-2017
Category:
Upload: jeffrey-rondeau
View: 415 times
Download: 0 times
Share this document with a friend
25
AntiPatterns: Avoiding the Traps of Bad Design Jeffrey Rondeau Software Engineer @JRondeau16 http://jeffreyrondeau.wordpress.com
Transcript
Page 1: AntiPatterns: Avoiding the Traps of Bad Design

AntiPatterns: Avoiding the Traps of Bad Design

Jeffrey RondeauSoftware Engineer

@JRondeau16http://jeffreyrondeau.wordpress.com

Page 2: AntiPatterns: Avoiding the Traps of Bad Design

http://spkr8.com/t/64201

Page 3: AntiPatterns: Avoiding the Traps of Bad Design

What is a design pattern?

Page 4: AntiPatterns: Avoiding the Traps of Bad Design

What is an antipattern?

Page 5: AntiPatterns: Avoiding the Traps of Bad Design

What is a code smell?

Page 6: AntiPatterns: Avoiding the Traps of Bad Design
Page 7: AntiPatterns: Avoiding the Traps of Bad Design
Page 8: AntiPatterns: Avoiding the Traps of Bad Design

public const int Three = 3;

Page 9: AntiPatterns: Avoiding the Traps of Bad Design

public const int Three = 4;

Page 10: AntiPatterns: Avoiding the Traps of Bad Design
Page 11: AntiPatterns: Avoiding the Traps of Bad Design

"If all you have is a hammer, everything looks like a nail."

Page 12: AntiPatterns: Avoiding the Traps of Bad Design
Page 13: AntiPatterns: Avoiding the Traps of Bad Design

Prioritize writing readable working code first

Page 14: AntiPatterns: Avoiding the Traps of Bad Design

Favor safety and maintainability

Page 15: AntiPatterns: Avoiding the Traps of Bad Design

If beginner: resist the urge to optimize

Page 16: AntiPatterns: Avoiding the Traps of Bad Design

If expert: delay the decision to optimize

Page 17: AntiPatterns: Avoiding the Traps of Bad Design
Page 18: AntiPatterns: Avoiding the Traps of Bad Design
Page 19: AntiPatterns: Avoiding the Traps of Bad Design

/* public class ContactValidator : BaseValidator { protected override ValidatorResult Evaluate(Contact contact) { if (contact.ValidationState != ValidationState.AwaitingValidation) { //TODO }

}

protected override ValidatorResult GetMaxValidatorResult() { throw new NotImplementedException(); }

public override string Name { //TODO Confirm name get { return "Temporary Name"; } } } */

Page 20: AntiPatterns: Avoiding the Traps of Bad Design
Page 21: AntiPatterns: Avoiding the Traps of Bad Design
Page 22: AntiPatterns: Avoiding the Traps of Bad Design
Page 23: AntiPatterns: Avoiding the Traps of Bad Design

client.GetMortgage().PaymentCollection().GetNextPayment().ApplyPayment(300.00)

Page 24: AntiPatterns: Avoiding the Traps of Bad Design

client.ApplyMortgagePayment(300.00)

Page 25: AntiPatterns: Avoiding the Traps of Bad Design

Jeffrey RondeauSoftware Engineer

@JRondeau16http://jeffreyrondeau.wordpress.com


Recommended