Project Standards
I recently played a leadership role in a project where two of the biggest challenges where the time schedule and the team on boarding.
I hate repeating myself, so after explaining the technology, architectural choices a couple of times I decided to write some kind of document or presentation.
I've created a sample document containing for each of the areas of the project a paragraph explaining shortly all the decisions made so far.
The document has been then showcased to the whole team for feedback.
So, let's see some part of the document, as example:
Services (A similar paragraph was written for each component of the architecture)
Why?
- To decouple layers
- To have isolated Transactionality
- POJO configured with Spring (context-service.xml)
- @Transactional annotation on any method call that requires Transactionality
- @Service class annotation for Spring
- @Autowiring constructor annotation for Spring
- Completely stateless
- Domain Driven Design
- We want a fast feedback and test only objects interactions rather than effects
- Test Double
- Mockito framework to verify objects interactions
- A Mock test should be written at least for
- Services (mocking DAOs, JMS)
- DWR Objects (mocking Services)
- Mockito homepage
- TestDouble page
- Martin’s Mocks aren’t stubs page
- Lightweight solution
- Easy to test out of the container (POJO beans)
- Goes very well with DWR, Terracotta and Atomikos
- Every bean is configured in a file called context-xxx.xml
- Spring Vs EJB 3
- New Spring 2.5 Features
- Spring Reference Documentation
- All fields private, information hiding
- Reduce as much as possible private methods (usually the logic that sits in private methods can be extracted in another class), also a private method is not directly testable by unit tests.
- use composition rather than private methods or utility classes, with composition every object can have isolated responsibilities and isolated own test
- Methods, variable, package, class names should be speaking and tell to who’s reading the code what they’re there for
- Avoid code smells, in particular:
- DuplicatedCode
- Methods too big
- Classes with too many instance variables
- Classes with too much code
- Strikingly similar subclasses
- An instance variable that is only set in some circumstances
- Comparing variables to null
- Too many private (or protected) methods
- Many messages to the same object from the same method
- ExcessiveOverloading
- SameNameDifferentMeaning
- Code not actually ever used
- Classes with too few instance variables
- Classes with too little code
- Methods with no messages to self
- Empty catch clauses
- Explicitly setting variables to null
- Comments
- ExcessiveLogging
- ContrivedInterfaces
- LawOfDemeter Violations
- SwitchStatements
- Daily Stand-ups 9.30 AM
- Two weeks long Sprints
- End Of The Sprint Retrospective
- Planning Game at the start of the Sprint
- Product Backlog
- Control Chaos Homepage
- Any Mike Cohn’ presentation or article about Scrum
- Any Mike Cohn’ presentation about estimating and planning