#Homework!
Contained in this repo are my solutions to the homework problems provided by Attila (the original questions are provided below for your reference). The repository is divided into two sections:
├── part1
│ ├── controller.md
│ └── memcache.md
├── part2
│ ├── question1/
│ ├── question2/
part1/ contains the written questions
part2/ contains the code challenges
All code was fully TDD'ed. I prefer keeping my commits small and granular, but they grew larger towards the end of completing part2/question2 as I was completing large logical "chunks" of the kata. Because it was straightforward enough to persist objects in memory I used a classical approach. However, no database backend or configuration is required.
Apart from wanting to do my best and show what I think of as clean, SOLID code, I also wanted to provide the team with a working example of the Repository Pattern along with Entities and Use Cases which I call contexts. I've also borrowed and adapted the idea of a Service Layer that coordinates the dependencies of the contexts and provides a simple interface for consuming those contexts.
I tend to prefer one method classes that respond to either call or execute. I've also adopted the idea of Interactors which wire together contexts across the main concerns of role, organization and user. I think this is probably a bit contrived for this kata, but wanted to share it with the team as I have found it to be a helpful way of orienting my thinking when working on large application code bases.
$ git clone git@github.com:rewinfrey/homework.git
$ cd homework
$ bundle
$ rake
I had a great time pairing with everyone on the team, and I am very excited to hear critical feedback. The chance to have other developers review my code and learn from them is a big win, and I appreciate everyone taking some of their time to look over this submission.
-
How can Memcache improve a site’s performance? Include a description about how data is stored and retrieved in a multi-node configuration.
-
Please take a look at this controller action. Please tell us what you think of this code and how you would make it better.
-
Write a program using regular expressions to parse a file where each line is of the following format:
$4.99 TXT MESSAGING – 250 09/29 – 10/28 4.99
For each line in the input file, the program should output three pieces of information parsed from the line in the following JSON format (using the above example line):
{
“feature” : “TXT MESSAGING – 250”,
“date_range” : “09/29 – 10/28”,
“price” : 4.99 // use the last dollar amount in the line
}
- Please complete a set of classes for the problem described in this blog post. Please do not create a database backend for this. Test doubles should work fine.
