On Monday, as LotusSphere 2010 got under way and lots of you waited eagerly(?) to see what's new with Domino, I on the other hand spent the whole day immersed in .Net development. Read in to that what you will, but the timing is purely coincidental.
Karen's friend's husband, Mitul, who also runs his own web development in Nottingham, came and spent the whole day walking me through developing a web application in Visual Studio.
We decided to start from scratch and build a blog template. First off we created some SQL tables. We then created some CRUD-based Stored Procedures for accessing the tables, before adding some Table Adapters to access the procedures from our code.
With the "data layer" in place we then created some custom classes to represent the data. The main class we worked on was called BlogItem and had properties such as Title, Content and Author. It also had methods, such as Save(), which would commit changes back SQL.
This was all very new to me and I immediately saw the benefits of the approach. Most of my (traditional) web development experience (outside of Notes/Domino) has been LAMP-based. In PHP I'm used to just building a SQL string within the PHP, executing the query and then using a For() to loop all the results. Using a data layer to abstract away from this approach has obvious benefits.
Starting with a Master.Template file we then built the foundation of all our pages and before long we had a web page which listed a set of blog entries, on which you could click to read each one -- both pages having common header/footers etc.
Taking it further we went on to add a class called User and added a login form to the application, which was based on a custom control element. This control included an Authenticate method which added an object, based on the User class, in to the user's session variables. At any point we can then refer to this User object and its methods such as User.hasRole("Admin") to handle the role-based security.
There were a couple of other bits we covered, such as how to output just XML, but I think we did quite a bit and covered everything I wanted to, considering we only had 8 hours in which to do it.
Although the end product isn't anywhere near a complete blog template, what it is is a good starting point for me to take it further and learn at my own pace. Now I'm over the first hurdle I'll find it much easier to continue developing.
While paying somebody to teach me a new technology isn't something I've done before or really wanted to do, it was definitely worth it. Instead of trying to find an hour here and there to learn, which was never going to work, having somebody with me for a day forced me to spend the whole day learning, which is always the best way to go.
Most importantly, what I came away with is a desire to learn more. I liked what I saw and look forward to working on the potential projects I have coming up, which might suit .Net better than they would Domino.