SCNA 2009 - Grand Unified Theory of Software Design: Jim Weirich
EdgeCase, LLC
Tech Interview
When interviewing over the phone, what do you look for? Passion?
"What do you look for in a good design?" Criteria?
Some principles:
Coupling and Cohesion - Myers
7 types of coupling - less is good.
Control Coupling
- Method has "flag" parameter that controls what algorithm to use
- Description includes "or" or "otherwise"
Connascence
Two pieces of software share connascence when a change in one requires a corresponding
change in the other.
From
What Every Programmer Should Know About Object-Oriented Design (book). Section
2 predated UML - irrelevant. Updated version is:
Fundamentals of Object-Oriented Design in UML.
Locality matters when looking at connascence. As the distance between pieces increases,
you want weaker connascence.
Connascence of Name (CoN)
- Names (type, etc.) must agree
Connascence of Position (CoP)
- Ordering matters
- Number of elements is relevant (more than 2-3)
- CoP -> CoN
- CoN < CoP (matter of degree)
- Basic OO - named properties OK, long method signatures not so good, omittable keywords
OK
Connascence of Meaning (CoM)
- Enums, constants take CoM -> CoN (good)
Contranascence
Things can't conflict with each other.
- Naming conflicts (namespaces)
- Two enums with same value
- Extension methods with same name
Connascence of Algorithm (CoA)
- Checksum generation code and checksum checking code
- Move to common method; share code (when possible)
- DRY
Connascence of Timing (CoT)
- Race conditions
- Convert to atomic operations
Connascence of Execution (CoE)
- Ordering of steps in algorithm relevant
Connascence of Identity (CoI)
- Objects must be same object (uniquing)
Connascence of Value (CoV)
- Values are related; constraints
Other Books
Your Host: webmaster@truewill.net
Copyright © 2009 by William Sorensen. All rights reserved.