I don't know why I'm continuing with this construction metaphor, but it has yet to fail me so I'm just going to keep going with it.

Thinking About Structure

In the last post, I discussed a lot about having a foundation to build upon. In this post, we're going to talk about structure. Primarily, I'll discuss the data structure, but we'll also have a look into project structure as well. For the most part, project structure isn't super important in .Net/C# because of the way the framework compiles. Data structure is always super important though because you can really goof everything up if you build on a bad premise.

When working on something with a known outcome, I like to look at what that outcome is and break it down into that parts. This is one of those projects, so we'll start by taking a look at an example résumé.

Example Résumé

Example Résumé
An example résumé I found in a google search. Source: https://resumecompanion.com/resume-examples/high-school-student-resume-sample/

I'm going to start at the top and figure out what we need to have in order to build this résumé.

Contact Information

The first block of the résumé has a few things.

  • Name
  • Email
  • City
  • State
  • Phone Number
  • LinkedIn URL
  • Website

I think this is a pretty good base to start with, so I'll create an object to handle it. We'll call the object ContactInformation in a folder called Models. As previously mentioned, I recommend doing this in a new branch.

git checkout -b structure

That command will create your branch and check it out so you can start working in it. Now you can use VS Code to create a new folder by right-clicking the project and selecting "New Folder". Call that folder Models and then right-click that folder and create a new file called ContactInformation.cs.

With the class created, we'll add the properties we need to have. It should look something like this.

namespace Web.Models {
    public class ContactInformation{
        public string Name {get;set;}
        public string EmailAddress {get;set;}
        public string City {get;set;}
        public string State {get;set;}
        public string PhoneNumber {get;set;}
        public string LinkedInUrl {get;set;}
        public string WebsiteUrl {get;set;}
    }
}

The important thing to note here is that, now and going forward, the namespace is going to be inportant to keep track of. That's how other parts of the application will know how to reference this object. VS Code will try to help you as you go, but it's good to keep an eye on it.

Education

The next section deals with education. It would appear that for this section we should have

  • School Name
  • School City
  • School State
  • Grade Level (or major)
  • GPA
  • Relevant Coursework
  • Honors
  • Clubs

So again, we'll add an file to the Models folder called EducationInformation.cs.

namespace Web.Models{
    public class EducationInformation {
        public string SchoolName {get;set;}
        public string SchoolCity {get;set;}
        public string SchoolState {get;set;}
        public string GradeLevel {get;set;}
        public double GradePointAverage {get;set;}
        public string RelevantCoursework {get;set;}
        public string Honors {get;set;}
        public string Clubs {get;set;}
    }
}

The one thing that I see in this immediately is that there may be multiple Honors, Clubs, and RelevantCoursework items that we want to work with. Instead of just having to type in a string, let's future proof a little bit and use a List that we can manipulate down the road.

using System.Collections.Generic;

namespace Web.Models{
    public class EducationInformation {
        public string SchoolName {get;set;}
        public string SchoolCity {get;set;}
        public string SchoolState {get;set;}
        public string GradeLevel {get;set;}
        public double GradePointAverage {get;set;}
        public List<string> RelevantCoursework {get;set;}
        public List<string> Honors {get;set;}
        public List<string> Clubs {get;set;}
    }
}

The using statement is important since a List isn't a primitive and we need some help to make it work.


We'll wrap this post up here since it's getting pretty wordy. In Part 2, we'll work on building out the other sections of the résumé and maybe start working on making sure they work together and play nicely.