Home

« March 2010

01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
This is the personal homepage of Christopher Chestnut which also contains information about myself, my interests and my work. This First Page is a blog page where I post what has been happening recently in my life and any recent upgrades to the site. Enjoy.

Presentation class woes solved

Using spring.net and nHibernate I was creating a class in the presentation layer to display the contents of a container. Now normally the presentation logic for an object would be in the webpage itself and thus the tying up of data access would be quite simple. Simply add a new line to your web.xml as below.
< object type="test.aspx">
< property name="ContainerBLL" ref="ContainerBLL">< /property>
< /object>

This would simply create the connection between the page test.aspx and the business logic layer's object ContainerBLL. I had however created my own class to house the presentation logic for displaying and dealing with a container, the reason for this simple, I wouldn't be duplicating effort if I needed to interact with a container on a different page, I would just be calling the same single class. This called its own problems as it was the container presentation logic class which was calling ContainerBLL not test.aspx so I needed to tye that class in somehow.

After a bit of tooing and froing I thought about spring.net's use of interfaces and tied it in that way. First I created an interface for the presentation class.
public interface
IcontainerInterface {
IContainerBLL ContainerBLL { set; }
ArrayList fieldObjects { get; set; }
ArrayList loadContainerEdit(Page page, int typeID);
}

public class containerInterface : IcontainerInterface
{

And then changed the web.xml to reference the class as a part of the page.
< object type="test.aspx">
< property name="containerInterface" ref="containerInterface">< /property>
< /object>

And finally the clever bit was altering the Business logic layer's Business.xml to create internal references to the business logic layer objects, not database access objects like what would usually be stored here.
< object id="containerInterface" type="NS.containerInterface, NS">
< property name="ContainerBLL" ref="ContainerBLL"/>
< /object >

Now it is working properly I can work on the more complex presentation logic.

Posted by Christopher Chestnut on 2010-03-02 13:50:00

Very useful site

Working with the new frameworks of Spring.net and nHibernate I came across this article which has been invaluable sussing out spring. Of course there is the spring manual but when just starting I found it explained many of the concepts of dependency injection that spring is famous for.

In summary spring does a load of the coding for you, you create interfaces for your classes, data access layer, business logic, and presentation layer and then create interfaces for them. Initially I could not understand why you would want to add this extra level of abstraction to the class, but this article explains that spring uses these interfaces to add it's classes to yours making it work. Its class, pun intended.

http://www.developer.com/.../Dependency-Injection-with-SpringNet.htm

Posted by Christopher Chestnut on 2010-03-02 13:28:30

In Training

Most of my projects have reached a natural stopping point. There is still more that could be done to make it even better as there always is in these sorts of projects, but the project is stable the latest design release is integrated so it looks fantastic and there are other projects that need my attention. That is where I am directing myself now, for the next few days I am delving into hibernate, no that's not what bears do in winter (well it is but it is not that type of hibernate I am talking about). "Hibernate is a powerful, high performance object/relational persistence and query service." Their words not mine. Hibernate is as different to traditional programming as object orientated programming is to functional programming, there is a logical leap, a mental bridge to get a cross (sorry for all the euphemisms).

Though for all the differences there are key principles what relate to what I already know, and I can definitely see the power. Especially the speed of development, with this structure up and running we should be able to build a test driven platform (so we can know it won't fail), quickly, reducing duplication of effort, and easily make the resulting code multiplatform. Literally if this works, as the materials I am going through lead me to believe, if we need to develop code for a different type of database or operating system, that would be considerably easier than it is with the current system, just add in a plug-in for the database of choice and away you go.

Posted by Christopher Chestnut on 2010-02-08 10:02:04

Intense Saving mode enabled

Seven months today will be the wedding day and I have started saving intensively, well tell a lie I have been saving constantly for a while but a large whack, pretty much all of that disappeared over Christmas , new year, and booking the honeymoon. So reduced back down to zero savings again it was time to re-assess my savings and start saving intensively, especially as certain key items have to be bought soon. Combine that with buying a house we probably won't be having any holidays for a while, well apart from the honeymoon. bigsmile

Posted by Christopher Chestnut on 2010-02-08 09:48:21

Great Christmas Dinner

This weekend we went for the company Christmas dinner at the Galgorm Hotel and Spa over Saturday night which was paid for by the company. It was fantastic the dinner was lovely and metaphors of i-Path as a bus were classic, secret Santa's were given out and much merriment was to be had. I also made good use of the Spa facilities were the best I have been to, though I may give the ice shower a miss next time. That will wake you up with a jolt. A very good weekend, great to see everyone together, and a great time to catch up with some of the more far flung members of the i-Path team. The best part of all though must have been that i-Path paid for everyone's partners to come as well so we were able to put faces to names of the wonderful people we had heard about.

Posted by Christopher Chestnut on 2009-11-30 15:06:41

New Twitter Client Feature

I have recently added a new Twitter Client to my website which I can use to add quick updates. It can easily be viewed from the twitter icon on every page or the twitter link on the front page.

Posted by Christopher Chestnut on 2009-11-06 23:33:58

Gift List added to website

As I keep getting asked and I don't know what to tell anyone as most of the things I would like are quite pricey i.e. a car, an Apple Macbook pro, PS3, XBox 360, etc. I have created a gift list page if you follow the Gift Ideas link at the bottom of the page. At the moment it only my amazon wish list but it should be a good start.

Posted by Christopher Chestnut on 2009-11-06 16:22:55

Buying a House

We have now put down a deposit on a new house in Dundonald, it looks fantastic and it is a new build which is even better. Though as it is still under construction we will not be able to move in until next year, but yay us!

Posted by Christopher Chestnut on 2009-11-06 16:19:59

[1] [2] [3] [4] [5] [6] [7] [8] [9] last »



*