...
Next time: Chapters 8 and 9.
Jan 27, 2016
Chapter 8 and 9
- Cliff discovered a useful tool! Mocking server for IDAs that need to talk to each other.
- There's also a python tool called beta-max which "caches" IDA responses (so you can write tests against responses)
...
- "What we talk about when we talk about testing" — "I'm sure there's a blog post called that out there"
- TDD
- Clean code: don't write more code than is sufficient to pass the test
- Relationship to red/green/refactor? — Similar, when you get down to first principles
- Sometimes DRY-ness in tests make them harder to understand (DRY = don't repeat yourself)
- DRY tests make it easier to do large refactoring
- DSLs for Testing
- Course DSL for creating courses in tests
- Using named-tuples for ddt --> makes tests more readable (could also use a dict)
Feb 10, 2016
Chapter 10: Classes
Small classes?
- Need better developer tools
- It would be great if our IDEs had a better visual tool for presenting relationships between our classes - so it's easier to understand how all the small classes fit together.
- EComm used django-oscar, which had a ton of classes - but made it hard to figure out where to start.
- Hard to discover classes, but easier to add new classes.
- Need better developer tools
- Single responsibility principle
- What is a responsibility?
- Underlying principles though help
- make complex code easier to understand.
- make it easier to test.
- Can go overboard on generalizing everything.
- Are the SQL classes in table 10-10 really better than the original code in 10-9?
- Description of the class without using if, or, and
...
- , but.
- Cohesion as a useful tool to gauge a class - as a guideline.
Chapter 11: Systems
- Dependency Injection
- decoupling, extension mechanism
- iOS attempted this for string resolution, but instead of passing the dependency through all layers, created a singleton as a lookup service.
- Enterprise Java Beans
- property setters/getters decoupled from the storage layer and the behavior
- Aspects
- Declare in a separate place all the before and after operations to do for its decorated methods.
- Separated Code dependency (code depending code implemented elsewhere)
- Aspects
- Python Mixins
- Python Decorators
- DRF is a good example for us to look at.
- Design exercise: What design patterns to use when designing an access control permission checking framework?