Monday, September 03, 2007
In the beginning of this year (april) I started using nHibernate. Having some experience in Hibernate (Java) I knew what to expect. So without RTFM or not enough anyway I started implementing it. And I used the attribute framework that came with it (version 1.2 beta 3) at the time. The learning curve was a bit high and over the next few posts you will understand why.

First of all I will start with a simple example which works well. In the beginning I couldn't find any good example in VB.Net using the attributes all were in C#.

nHibernate can be downloaded here

So this is what a normal class would look like in the Chrissie1 universe. Nothing special a person with a firstname and lastname. And you will notice that I already added an Id In a perfect world I wouldn't need an Id since firstname and lastname togther would make for a perfect id, but since the perfect world only exists on TV I add it since the beginning. I can always add comparers/constraints later. In the next post I will change it to suit the needs of nHibernate. But for now enjoy it's beauty.
Namespace Model
''' <summary>
''' A normal person
''' </summary>
''' <remarks>For testing purposes</remarks>
Public Class Person
Implements IComparable

#Region " Private members "
''' <summary>
''' A local variable called _id of type String
''' </summary>
''' <remarks>Has Property Id</remarks>
Private _id As Guid
''' <summary>
''' A local variable called _firstName of type String
''' </summary>
''' <remarks>Has Property FirstName</remarks>
Private _firstName As String
''' <summary>
''' A local variable called _lastName of type String
''' </summary>
''' <remarks>Has Property LastName</remarks>
Private _lastName As String
#End Region

#Region " Constructors "
''' <summary>
''' Default empty constructor
''' </summary>
''' <remarks></remarks>
Public Sub New()
Me.New(Guid.NewGuid, "", "")
End Sub

''' <summary>
''' Constructor with all the fields
''' </summary>
''' <param name="Id">DataType = String</param>
''' <param name="FirstName">DataType = String</param>
''' <param name="LastName">DataType = String</param>
''' <remarks></remarks>
Public Sub New(ByVal Id As Guid, ByVal FirstName As String, ByVal LastName As String)
Me.Id = Id
Me.FirstName = FirstName
Me.LastName = LastName
End Sub
#End Region

#Region " Public properties "
''' <summary>
''' This is the Id property.
''' </summary>
''' <value>Guid</value>
''' <returns>Guid</returns>
''' <remarks></remarks>
Public Property Id() As Guid
Get
Return _id
End Get
Set(ByVal Value As Guid)
_id = Value
End Set
End Property

''' <summary>
''' This is the FirstName property.
''' </summary>
''' <value>String</value>
''' <returns>String</returns>
''' <remarks></remarks>
Public Property FirstName() As String
Get
Return _firstName
End Get
Set(ByVal Value As String)
_firstName = Value
End Set
End Property

''' <summary>
''' This is the LastName property.
''' </summary>
''' <value>String</value>
''' <returns>String</returns>
''' <remarks></remarks>
Public Property LastName() As String
Get
Return _lastName
End Get
Set(ByVal Value As String)
_lastName = Value
End Set
End Property
#End Region

#Region " Overrides ToString "
''' <summary>
''' Overridden ToString method for this class
''' </summary>
''' <returns>String</returns>
''' <remarks>The String value of this class represented by the ToStrings of all it's private members</remarks>
Public Overrides Function ToString() As String
Dim ReturnString As New System.Text.StringBuilder()
ReturnString.Append("[Id: " & _id.ToString() & "]")
ReturnString.Append(" - [FirstName: " & _firstName.ToString() & "]")
ReturnString.Append(" - [LastName: " & _lastName.ToString() & "]")
Return ReturnString.ToString()
End Function
#End Region

#Region " Overrides Equals "
''' <summary>
''' Overridden Equals method for this class
''' </summary>
''' <returns>Boolean</returns>
''' <remarks>The Boolean value indictaing if this is equal to the other class</remarks>
Public Overrides Function Equals(ByVal obj As Object) As Boolean
If obj.GetType Is Me.GetType Then
Return Me._id.Equals(CType(obj, Person)._id)
Else
Return False
End If
End Function
#End Region

#Region " Overrides CompareTo "
''' <summary>
''' Overridden CompareTo method for this class
''' </summary>
''' <returns>Integer</returns>
''' <remarks></remarks>
Public Function CompareTo(ByVal obj As Object) As Integer Implements System.IComparable.CompareTo
If obj.GetType Is Me.GetType Then
Return Me._id.CompareTo(CType(obj, Person)._id)
Else
Return -1
End If
End Function
#End Region

End Class
End Namespace

9/3/2007 12:38 PM Romance Daylight Time  #    Disclaimer  |  Comments [0]  |  Trackback
 Sunday, September 02, 2007
I like the articles on the code project most of them are high quality and to the point.

This i one that could be usefull in the future.

http://www.codeproject.com/useritems/Code_Quallity_Assurance.asp

The only problem I have when seeing this kind of tools is, when do they find the time to code ;-).

9/2/2007 12:25 PM Romance Daylight Time  #    Disclaimer  |  Comments [0]  |  Trackback
 Saturday, September 01, 2007
If like me you like the sidebar in IE (yuck) then this is the one to go for in firefox, it's even better then yu imagined. It just creates an empty window when you download, but you can just ignore that (actually I think it's firfox that creates it.

Sidebar

9/1/2007 2:25 PM Romance Daylight Time  #    Disclaimer  |  Comments [0]  |  Trackback
A couple of weeks ago I installed a program to share my bookmarks between several computers I first started out with ZinkMo but it was to unstable. And then I tried FoxMarks, which only works on firefox, which works great. Of course I forgot it's name when today I wanted to install it on my desktop and had to startup the laptop to find it's name. But here it is.

FoxMarks

9/1/2007 2:18 PM Romance Daylight Time  #    Disclaimer  |  Comments [0]  |  Trackback
Apparently the spellchecker on dasblog will only work on IE. So no spellchecking for me since I use firefox. I know you guys are going to read this anyway. And if you like you can always mail me with any good tips.

9/1/2007 1:59 PM Romance Daylight Time  #    Disclaimer  |  Comments [0]  |  Trackback
On my search for a blog-engine I found this little beauty

csharp-source.net


9/1/2007 11:38 AM Romance Daylight Time  #    Disclaimer  |  Comments [0]  |  Trackback
Well this starts my blogging adventure on the WWW (as they used to call it).

I'm using dasBlog from this man.

Setting it up was a little challenge but nothing a man like me ;-) can't handle.

This thing is actually easy to setup if you RTFM, but since I'm lazy by design, I didn't.

So here was the important thing I didn't read.

The ASP.NET worker process identity, usually “{machinename}\ASPNET” on IIS5.0 (Windows 2000 and Windows XP) or “NETWORK SERVICE” on IIS 6.0 (Windows Server 2003) also need read/write access to the content, siteconfig, and logs subdirectories.

BTW I forgot to change the site.config and sitesecurity.config the first time too, but I won't tell if you don't. So I uploaded it two times then changed the permessions and voila here it is..

9/1/2007 11:08 AM Romance Daylight Time  #    Disclaimer  |  Comments [1]  |  Trackback
Is this the one?

9/1/2007 11:01 AM Romance Daylight Time  #    Disclaimer  |  Comments [2]  |  Trackback
 Wednesday, July 20, 2005

Be sure to visit all the options under "Configuration" in the Admin Menu Bar above. There are 16 themes to choose from, and you can also create your own.

 

7/20/2005 9:00 AM Romance Daylight Time  #    Disclaimer  |  Comments [0]  |  Trackback