Week four: three down and nine to go. Thinking of it that way almost makes me a little sad that I only have nine weeks left, but it also inspires me to push myself to learn as much as I can.

This past week in class we took some big steps in terms of building out actual applications and linking together the major working parts of the Model, View and Contoller. When it comes to actually writing the code and getting everything to work I feel like I have a pretty good grasp on it, but this weekend our homework was reading more about Model associations and it’s the “big picture” logic that’s my current challenge.

I’m working through how to apply the apps we know how to build to solving a real-world problem or vice versa- what sort of problems we can solve using the apps we know how to build. I think I’m tending to make either my problems or solutions a little too complex (at least at this point in my limited programming knowledge). Bear with me as I type through an example off the top of my head.

Models are your various sets of data inside an app and it’s taking me some time (and lots of pen & paper sketching) to figure out how I’d like to associate various models inside an app. Let’s use Carmax as an example. They have several lots (the ‘lot’ model) and lots of cars (the 'car’ model). Since only one unique car can be on one lot at any given time, but each lot has many cars, I would type in my 'car’ model that it

belongs_to :lot

and in my 'lot’ model I would type that it

has_many :cars

Now that wasn’t so bad. I could now build out an app to show all the cars, all the lots, what cars are on each lot, and what lot has the car you want. (Thanks to some help from my classmate Raghu I could even start adding in search paramaters).

Maybe I just need to keep it simple like that. I’m probably trying to build too many associations for the various made-up apps in my head right now.

Problem solving like this is the part of programming I always heard about but I never realized how big of a role it played. I’m exercising my brain in ways I haven’t in a long time and it feels great- just like getting into the gym or starting up a running routine again. I may be a bit wobbly at first, but eventually I’ll get the hang of it.