Friday, June 6, 2014

Day 20: DataMapper ORM

Wow so that wraps up 1/3 of the entirety of the bootcamp.

This morning's lecture consisted of a couple algorithms and discussions on how to solve them. They were typical technical interview questions like: Write an algorithm that will tell you whether one word is a permutation of another, how can you tell if a word has all unique characters? Then do one without using a temporary array. We'll be doing these on a more regular basis throughout the bootcamp.


Up next on the morning lecture we learned about REST architecture and how we should structure our application according to the REST principles.


There should only really be 7 methods for each controller because a user would only need these 7 functions: create, show, update, delete, new form, edit form, and show all(index).

Then once again back to the assignments. We to recreate some applications that we've done before however we were to speak to the database using Object-Relational Mapping. That's just a fancy way to say a more object-oriented and elegant way of making queries to the database. Some popular frameworks like Rails do not even use regular SQL queries and only use ORM for database connections. It's super interesting because I know there's a lot of people that are learning rails and ORM but they actually have no idea what is going on behind the scenes. I'm just glad I'm not going to one of those Hacker schools that don't teach you what's actually going on behind the scenes.

I must say for the first 4 weeks, I've been cruising along. Sure I've had some difficulty, but it was nothing I couldn't do. However today, I hit my first real wall. The syntax and structure of ORM was quite difficult to grasp. I know one day it'll be beneficial for me to be using ORM but the learning curve was much steeper than I expected. I'm definitely going to be working this weekend so I can solidify my understanding of it.

Here's a quick screen shot of ORM. Notice it's a different than normal SQL queries.


Rather than speaking directly to the database, ORM allows us to treat each SQL table as if it's an object and gather properties of that object from that point.

That's about it for the day, I'm very glad that it's Friday and I get to relax for a little bit. This week has been pretty tough for me as well as the rest of my classmates. We are all pretty tired from data overload, but we are always here to cheer each other up and give encouragement. Before I go I just wanted to show everyone a glimpse of my workstation. There's a lot of monitors available at the Dojo and recently I felt the need to use 3 monitors: one for my code, one for my output, and one to see the assignment requirements.


No comments:

Post a Comment