Skip to main content

Week 6 - DALs, Integration Testing, DI, Capstone

· 4 min read
Joe Osterfeld

It’s the Sunday following my 6th week of Tech Elevator’s Spring 2017 coding bootcamp.

This week was a challenge. On Monday and Tuesday we learned how to connect databases to C# programs and write integration tests to ensure functionality. This will allow us to create programs which interact with databases; pulling, entering, or changing the information. On Wednesday we discussed object oriented design concepts like dependency injection (DI) and inversion of control. We finished off the week with our second ‘Mini Capstone’ project which was assigned on Thursday, to be completed by Monday.

While I found the database portion of the bootcamp simple and straightforward, it’s brought up really interesting object-oriented programming topics. My favorite day this week was Wednesday. We learned how to create Data Access Layer (DAL) classes within our C# programs, which are used to access external sources like databases and files. With DALs in mind, we discussed ‘dependency injection,’ which is an abstract concept in object-oriented programming.

In short, dependency injection means eliminating objects’ external dependencies, which allows us to more easily go back and change our program. The advantages of dependency injection are akin to small business owner hiring a human resources (HR) person to handle employee benefits. In this analogy, the programmer is the business owner, dependency injection is the HR person, and all objects in the program are the employees. Let’s say one employee, Casey, needs special accommodations for health insurance. Before the HR person was hired, the business owner had a lot of work to do; changing the company benefits policy, notifying all employees that a special health insurance package is available, and finally, changing Casey’s benefits. After hiring an HR person, everything is taken care of; all the business owner has to do is sign off on Casey’s benefits. Similarly, after implementing dependency injection, the programmer has given him or herself the ability to change any one object without having to change all of the others. In our analogy, this was done by shifting all of the employees’ benefits needs to the HR person. In programming, this is done by concentrating all objects’ dependencies to a central location so you only have to make changes once.

I’m really excited to develop a better understanding of all the concepts we’ve learned in coming weeks. Next week we are diving deeper into dependency injection, Inversion of Control (IoC), and the ASP.NET model view framework (ASP.NET MVC).

This week’s capstone project was a challenging way to put all of our skills to use. We were given a SQL file which creates a database containing the campsite information for U.S. National Parks. We were tasked with creating command line program used to show the parks’ information, search for campsite availability, and make reservations.

This project revealed my competitive nature. After my team was first to complete the initial project, it’s become my goal to repeat this performance for each of them. From the time the project was assigned, it was a race to get done. First, we sketched out the program in unified modeling language, and discussed how it would work for about three hours. Once the entire program was drawn up, we created empty classes, and started coding. We had about half of the project completed by Thursday, and on Friday, my partner didn’t show up until 1:30pm with little notice. Concerned about finishing the project on time, I worked on it alone for most of the day. Fortunately, it all worked out, and I had a working version by Friday afternoon, before any other team. I’m happy with the program’s design and functionality, and especially proud to keep my ‘first to finish’ streak alive. Click here to check out the project’s code!

Since this week was so demanding, I haven’t made any progress on side projects. I’m a little concerned about finishing a worthwhile side project before the end of the bootcamp. In previous posts I’ve discussed building a Google Chrome extension, a web application for a local business, or a mobile app for my friend’s new company. I really want to finish a side project before the bootcamp ends in April, but there’s a ton of coursework that’s taking precedence. I also have to focus on finding a job for when I graduate. I’ve had some downtime to explore projects in previous weeks, so hopefully things lighten up a bit.

Phew! That was a long post. Thank you for reading! If you have any questions find me at joeosterfeld@gmail.com