15 ms·
Good work in coming up a unknown design approach by yourself. This is basically test driven development, or before that the object orient analysis. That guy i
by ww520 15y ago
Good work in coming up a unknown design approach by yourself.
This is basically test driven development, or before that the object orient analysis. That guy interviewing you was following the object orient analysis approach. OO is sort of out of favor with all the functional fads in force.
OO Analysis is actually quite elegant, despite all the complication added later on. It can simply go by this:
1. Describe in English what your system will do. Be specific about the actors involved and their actions.
e.g. Let a user projects earnings and expenses over a period of time; summarize net effect.
2. Pick out all the interesting nouns and all the verbs. The nouns become your classes and the verbs become the methods.
3. Pick out the interactions between the nouns. Added those as methods on the receiving classes. Figure out the data of the interaction, which becomes the method parameters.
From that you can do the TDD approach to build the tests to exercise the skeleton code according to your system description. And from that fill out the actual functionality of each method as you run each unit test.
- xtracto 15y ago>This is basically test driven development I thought the same thing. Just a week ago I finished reading the "Pragmatic Unit Testing in Java" book and after skimming through the article I remembered the "design unit tests first" approach which forces you to think about the API (or exported methods). I have not used it myself, but it seems quite sound.