Summer Internship - Fulcrum Technologies - Week 1

// TODO: Add fluff intro text

My first week at Fulcrum Technologies, I was asked to build upon their interview coding challenge. The task was simple, create a shopping cart java app that takes into account item type and isImported? to charge the correct rate for sales tax. This was to evaluate how as a sophomore CS student can I code, judging at how clean or modular my code is. This was to make sure that my code is adaptable to changes in the future and to move an app that contains almost no hardcoding for aspects that change over time in any store.

List of what I've learned:

  1. SOLID by Refac Tor
  2. Apache Maven
  3. Tomcat
  4. (A Dream of) Spring
  5. Spring vs Django
  6. Controlla(ers)
  7. Views (from the 6th)
  8. Components
  9. Bootstrap
  10. SQL
  11. PSQL
  12. JOOQ
  13. Services

1. SOLID by Refac Tor:

Single responsibility principle

This is responsible for A and B

This is probably the best first step to look as when re-evaluating ones code. I started off with one single file to do everything. The initial task was simple. There were hard-coded inputs to replicate a desired output. This file did not need objects. It defeated the purpose of JAVA as an OOP language. I stored everything in simple Lists or Arrays and did very basic calculations on it. So the first step was to refactor the code to break it down in a way that each file has one and only one object and purpose. This resulted in breaking down my one single file to 5 files: Store, Item, ShoppingCart, Register, Receipt. Each file had its own step, just like in a supermarket.

Open/Close

We won't be able to to do that without modifying the existing code

The idea is to write code that is open to extension but closed to modification. The item object should have enough information in it that when a new type of item comes along, the old code is compatible with all its properties and also open to extending features in the app.

Liskov substitution

You cannot use that implementation of A here

Practice inheritance in objects in a perfect way so that methods are usuable for all types. A circle should have all methods of a shape.

Interface segregation

You have to implement these methods even though you wont use them

Dependency inversion

This is difficult to test because I cannot mock X

The code should be broken down in a way that a single component can tested by mocking all its dependencies.

2. Apache Maven

As part of my coursework, I had to learn how to use ANT to build and manage projects but school can only teach you so much. It is a very different environment in a company. There are expectations and standards on how to organize files. Maven was the first new piece of software that I had to pick up this week. Not sure I totally understand it or not but I think with new projects in the future, I should get used to it. The best part is that the only time that I have to deal with Maven is at the very start of the project and after that it just works.

In order to use Maven, it expects us to organize our files in a certain way at first. This is the typical source-target format. After I got setup, this folder structure felt very intuitive and logical.

3. Tomcat

Tomcat is a HTTP web server provider. It creates a local server for our web-app/site to run on. Tomcat is again a one-time setup thing which allows for integration with IntelliJ, JAVA SE and Maven.

4. (A Dream of) Spring

Spring I/O is the software that finally helps us use our java applications. Spring reminded me a lot of Django in the sense that it is a similar application. It provides for the framework and code to connect my JSP views to JAVA applications. A feature of Spring that I absolutely love is annotations like @Autowired

5. Spring vs Django

The very first difference between the two is that Django is based on Python versus Spring, which implements JAVA. Django is a relatively new framework, and even though the difference is only three years, spring felt more documented and better organized. The fact that Spring is JAVA based, also made it easier to work with when creating bigger applications. Sessions were a lot easier to implement in Spring as some support came turned on right out of the box. The entire, spring, maven, tomcat, all running on intelliJ worked really well to integrate SQL, which I have had a hard time to do so with Django and PyCharm in the past.

6. Controlla(ers)

I loved the concept of controllers as the java code behind the web pages. This tied in well with the SOLID way of coding by separating individual steps as single controllers which all call the 5~6 java files which I already had running.

7. Views (from the 6th)

Views is very similar to what I saw in Django but instead of using html files, this time, I got to use JSP files. The only thing I find confusing with this is the best way to implement java code within the view or to create perfect forms. This is getting better as I refer to old code and try to build on it.

8. Components

Components, I found these an interesting way of connecting my already working JAVA files and code to the new Spring framework of things. This annotation itself has probably saved me hours of work. Good thing this exists.

9. Bootstrap

I have always just downloaded free open CSS stylesheets in the past and never bothered to mess with bootstrap in the past. Now I understand why people make a big deal out of this and how convenient it is. The more I use it, the easier it gets to remember specific names for buttons and syntax.

10. SQL

Never been a fan of SQL but always accepted that it is the backbone of any app worth using. Took 2 hours to brush up on the commands online in order to not google every statement while working on my app. Would love to spend further time in the future to learn more about how to streamline my commands and learn the full extent of this beast.

11. PSQL

The easiest flavor of SQL I have used till date. The thing I am very thankful for is how easy it was to integrate with my current application as opposed to MsSQL, which I used in the past. Love the easy install process and would love to use this in my work in the future.

12. JOOQ

I think I'd lie for you, I think I'd die for you... like controlla

JOOQ is probably the best thing that happened to me. It saved me nightmares that I had last summer trying to link SQL into my code. MsSQL with Django (based on Python) running on PyCharm was the death of me. There was ONE open source way to link it and it would never work for me. JOOQ is amazingly documented and the commands are very intuitive. I absolutely love it.

13. Services

I like the concept of completely separating the SQL part of the app from any other part of the code. I understand that this a good way to practice the D in SOLID. We can create a fake service and test the rest of the code without having to worry about the database part going wrong.

To my boss and mentor, Cosmin Stejerean,

Low Lights - Kanye west

You want me to give you a testimony about my life, and how good he's been to me.
I don't know what to tell you about him,
I love him so much with all my heart and my soul with every bone in my body I love him so much because he's done so much for me. 

Every morning, every day of my life.
I won't always be crying tears in the middle of the night, and I won't always have to wake up by myself wondering how I'm gonna get through the day.
I won't always have to think about what I'm gonna do and how I'm gonna, how I'm gonna make it, how I'm gonna get there, because he...
he's gonna be there for me. Some day the sky above will open up and he will reach out his hand and guide me through, oh yes he will.
I won't always be crying these tears. I won't always be feeling so blue. Some day, he will open up the door for me and call my name.
Some day he will. I don't know if anybody understands what that feels like.