Application Building Process
So you want to start a new project, right? There are a few steps that are taken to a finished project. From Start to finish I’m going to give you the steps I follow. For this test, we’re going to build a blog system.
Step 1 - Fleshing it out
This step is essentially “wireframing” your application. I like to plan out my Database tables, the applications pages (and the features on those pages), then write out what classes I’ll need specialized for this project. We’re going to keep things simple for our blog, we need to strip some features including comments, ratings, sidebars, and search. It comes down to displaying all the posts on the main page, a page to view individual blogs, and the admin panel where you can add blog posts. So let’s start with our database tables.
Posts
- Post ID
- Post Author ID Foreign Key
- Post Title
- Post Content
Users
- User ID
- Email Address
- Username
- Password
- Password Salt
- Firstname
- Lastname
- Name
We’re building a small blog system, so these tables are pretty much the only two tables we need. The Post Author ID Foreign Key is the User ID from the Users table. We will do a table Join of the User ID that matches the Author ID foreign key so we get data to display about our Author when we display posts. The next step is to write the special classes for this project. We’ll need to classes with these methods.
BlogPosts
- Create Post
- Read Post
- Update Post
- Delete Post
BlogUsers
- Create User
- Send Verification Email
- Verify User
- Update User Email
- Update User Name
- Update User Password
- Login User
- Logout User
First things you’ll notice that all the BlogPost methods are CRUD (Create, Read, Update, Delete). This is because that’s mostly all you can do with a Blog Post. Now, you can write your code with these classes. Now, we need to decide which pages will be on our site.
Main Page
Post Page
- Show Blog Post and Author Information
Admin Panel Page
- Login Users
- Logout Users
- Create Posts
- Update Posts
- Delete Posts
- Update User Info
- Create Authors
- Update Authors
- Delete Authors
As you can see, the most activity will happen on the Admin Panel Page. This is mostly because the Blog is static in a sense. Even though it’s technically not static, there is no User Interaction. It’s just dynamically loading content that is read. If we had comments and ratings and retweet buttons, yes, there would be more features on these pages, but since not, this is all the info we need.
Step 2 - The Drawing Board
Now that we have a gameplan for our application, let’s design what our application will look like. This is usually pen-and-paper quick sketches. Maybe a block that says Blog post. Maybe a place to put the Website title. Then you can sketch out the Admin Panel, move some buttons around. Where the login forms will go. This is just simple sketches. Once you have those done, design a page flow. This is a graph with blocks and arrows, from what page will bring you where so to speak. This isn’t necessary, but it does help when building your application. Once you have a skeletal design of what you like, if you are a Photoshop/Fireworks person, now you can design what your site will actually like. If you don’t like to draw out your last design, skip to the next step. Drawing out your entire site can help the HTML/CSS step. So I suggest designing every element of your website. Including error messages, success messages, and just messages. Design forms, design text. Do this all before you work with the code.
Step 3 - HTML/CSS
This step is where things start to get interesting, now that you have designs of all the things you’re going to work on for your blog. You can now start building the HTML/CSS. I suggest building your directories before you start doing this too. Just so you have a good piece to work with. No dynamic code is in this step, you can insert comments of where dynamic code will be, but this will strictly be static designing here. Lorem Ispum really. The purpose of doing all the HTML/CSS first is so you aren’t juggling dynamic development and designing all at once. Getting yourself lost at points. So, just take this step easy and get everything designed. For our Blog, I design the Admin Panel and the main pages. My Website title is “Shane’s cool Blog” and everything is now themed. I can now move on to the next step which is development.
Step 4 - Development
By now, you have a decent static model of your application. Now is where you add all the cool stuff to it. Backend code. This will give the breath of life to your application. First let’s start with the easy stuff, giving life to our classes. We build a skeletal model of our classes with just method names. Now, put code into those methods. Build form handlers and the login system. Error catching and reporting. All of this is done in this step. Once you have something that you think is decent. Move on to the final step of application building.
Step 5 - Testing
Testing is by far the most important part of application building. If you don’t test, all the other parts of your application are meaningless. Testing allows you to debug and get rid of bugs and problems in your application. If there was a crack in your code, you can fix it. Testing is the last step before you launch your application. Simple things you can do are sign up users with the same email address, put random info into forms. Try submitting forms with empty values. See what happens when you try to go to blog post a million. Make sure that there is a blank index.html file in all your directories so people can’t access your sensitive files and images. Once you have a perfect application. You are ready to launch.
I hope this tutorial has helped you. Obviously, some of these steps can’t be used if you are using development patterns like MVC. You have to tweak some of those things a little bit. There are other ways of building an application, but this is my personal favorite. I hope that your application building process goes great. I used to build applications very messily and it can be frustrating at times, so this should help you maintain.
- Happy Coding