In this series of notes: https://twitter.com/ajavadeveloper/status/1145615948277112833
I only notes part of "Fundamental Principles of Interaction"
It's just a small unit of this book, but already help me A LOT.
Whenever I'm confused of designing, I re-read this book to get more ideas.
Because I'm a developer, so the most important thing it taught me is:
Why we need write clean code, how a clean code look like? How to know a design is good or bad.
- Affordance and Signifier: That's why we need good naming.
- Ex. visible signifier
StringUtils.trimToEmpty
StringUtils.substringBetween
- Ex. Invisible
String dateString = PrivateDateUtils.toDateString( date ); // What is the format?
@SuperAnnotation // Things become invisible when there are many decision made at runtime, developer won't know.
public class NormalClass {}
- Mapping and Conceptual Models: Developers always handling mapping and conceptual models
PersonDao.persist( person ); // Clear model, dev expect it will persist
Person.save(); // May be a little confuse
personService.find( id ); // When a find method persist data due to other reason such as queue full or statistics, it become confusing
- Feedback: We need many feedback, no matter in code or in performance tunning or monitoring
personService.find( id ); // It's better to response quickly
personService.find( id, timeout, TimeUnit ); // It's better to provide timeout when things may become long
public void find(String id) {
try {
personDao.someErrorMayHappen();
} catch (Exception ex) {
// Eveything is find, treat as no data
// Eveything is find, treat as no data
}
}
- When there are too many error, we even unable to know the feedback is valid or not

沒有留言:
張貼留言