Showing posts with label Website Design. Show all posts
Showing posts with label Website Design. Show all posts

Saturday, 19 May 2012

Patterns and Practices

In a previous post, I mentioned that I had written the bulk of the database that will drive the website. This is still true, but after reading a few articles on the Code First pattern, I have decided to leave the database portion of the website alone for the time being and concentrate far more on the API using the code first and repository patterns. This is something new for me, as in previous projects, I have always had a database to read everything from before doing anything by way of front end testing. The pattern is made really simple when using Ninject to create a mock data store from which to read the data, and I have to say that I am really enjoying coding this way.

Generally, when using the code first pattern, a developer will allow the Entity Framework to go ahead and create the database for them when they run the project. I'm not sure I quite agree with doing it that way. I might allow it to create the database when I need to, and see what it comes up with and how it fits in with my knowledge of database schema design. To be honest, the bulk of it should be OK, but I like to be more in control of my own indexes and foreign key constraints as part of the database design which is why I am a little reluctant to have the database generated. Time will tell as to whether this works out.

In the meantime, I now have a fully working setup of Visual Studio Express which works a lot more like the professional setup that I use in my day job. It takes a bit of hacking around, but getting things such as StyleCop to run under the environment is very important to me. I admit that using StyleCop to evaluate code structure is something that a lot of developers don't like, but it is something that I find extremely useful as it helps the navigation of the code, and makes me a little less lazy with the documentation of the project. Getting StyleCop to run under Visual Studio Express for all projects can be a little fiddly, but a little research led me to a really simple solution which I will share in my next post.

In the meantime, it's back to the coding for a little more of my Sunday afternoon, after which I need to go and find a replacement for my broken kettle (one of the most important tools in any developers armoury!)

Happy Sunday :0)

Sunday, 6 May 2012

Coding on a Sunday night

It's a quarter past twelve on a Sunday evening and I'm sitting here blogging and coding. I really should be in bed right now, my alarm is due to go off in a little over 5 hours. But the fact is that I am enjoying myself. The database for the new website has had a few minor changes this evening. Most of this is not because of any redesign as such, but because of me forgetting to include a few key parts of the website. I should have done a proper project plan before starting, but hey, I'm a developer, not a project manager. I know this is completely the wrong attitude if we look at all the books on building websites. There are certain rules that everybody is supposed to follow. But the fact is that many of the websites that we use on a day to day basis do not follow this. They are the sorts of projects that are developed in code as fast as they are developed in the head of the person that is coding them.

So where are we at? I have the database there, with a few parts still missing (the scripts are coded, but the columns and tables themselves are not there yet. I will be putting them in later, and they are definitely in mind when I'm working on the front end!). I also have a few pages, and parts of pages for the new site.

The security has been taken care of, although at this time I am not entirely sure whether I am going to rebuild the security side of things myself. At the moment, I am reluctant to do so, as the project already has the standard MVC security there and I have no users on the site. It may be changed in the future, but not now. The pages I do have are slowly taking shape. I am concentrating on the front end user interface at the moment. The CSS is taking shape and I am testing against Google Chrome and Internet Explorer just to make sure that it all works. Of all of the Internet browsers, Internet Explorer is the one that I have had the most trouble with during my career. IE has always had trouble keeping up with certain Internet standards which have been adopted early by the likes of Google Chrome and Firefox, so much of the front end testing will be against IE. Looking at the stats from my other blog, I will be needing to make sure that I have tested against several versions of IE. For this, I am using IETester, a great program that allows you to test the front end of a site in multiple versions.

I am also thinking about the front end from a mobile browser perspective. Any site these days needs to have mobile support as many of the potential page hits will be from a mobile source. This needs a little more investigation as it is not something I have really had to deal with before.

Back to the coding!

As a side-note, I am leaving the Foo Fighters alone for tonight, and using one of the other motivational tools that I have to hand... I don't know quite what it is about The Social Network that gets me motivated, but it never fails to get me in the mood to create something!

Thursday, 3 May 2012

Making A Start


I am a very firm believer in building a website from the ground up. It's all well and good having a really good front end but if the back end code doesn't work, a pretty site is as good as useless. That's not to say that some of the design work shouldn't be done before hand. You couldn't, after all, build something without having some idea of what you are wanting it to do. But I have seen websites before that I can tell the developers have spent a lot of time designing a pretty user interface but not a lot of time on the background code. These sites look really pretty, but as soon as more than ten people are using it, the site slows considerably, or the Javascript doesn't work, or updating data will take too long.

For this reason, I have decided that I am first going to concentrate on the database. I need somewhere to store the data and content that I am hoping the users of the site will provide. I have some ideas in mind of what is going to be in the database, how much data there will be, and what the common searches will be, so it shouldn't be too difficult to get the first few tables with their relevant indexes, constraints etc in place. I am concentrating on the basic functionality to begin with, but will try to leave the tables open to the more complex functionality that will come later.

Time to start writing some table definitions. I know that there are many other ways of creating a data store these days, but for some reason when it comes to creating a database, I like to do things by hand. I have a very specific way of writing database creation scripts that I have been using for many years now. Certain parts of the way in which I write the scripts have changed over the years, but the basis of it remains the same. I feel a lot happier writing the scripts by hand as I find it easier than relying on the overly fiddly user interfaces that some database builders will use.

Time to break out SQL Server Management Studio and get to work