Learning Objective-C

October 23, 2007

Since buying a MacBook I have been telling myself I need to get involved with a bit of Cocoa and learning how to write programs for OS X this involved learning a new language - Objecttive-C.

I already have a good grasp on C/C++ and Obj-C is basically just an extention to the C language so I thought it wouldn’t be too hard. I must admit I have taken to it pretty well, and can see the advantages to less strongly typed languages.

I had to get my head around the new method calling syntax which is very similar to smalltalk and the notion that you should think of object orientation in a different way but it’s always good to open your mind up to different paradigms.

Obj-C takes a different view to OO in that instead of always ’subclassing’ objects you should create new ones and ‘cosume’ existing ones. This is common with less strongly typed languages as far as I can gather and it’s more about what objects know about other objects rather than an inheritance chain that is more common to strongly typed languages.

I bought Cocoa Programming for OS X from amazon because the Apple documentation is more for reference than learning. I’m nearly half way through it in a couple of days so I would definately recommend this book very highly if your looking to learn Cocoa.

Anyway hopefully I’ll be able to post up my first real Cocoa program soon.


Disposing Windows SharePoint Services objects

October 22, 2007

I came accross this article on MSDN about disposable WSS 3.0 objects. I recommend anyone working with the SharePoint object model to give this article a thorough read.

The article outlines the fact that the two main classes in the object model SPSite and SPWeb both use unmanaged code and without proper disposal can seriously harm the performance of your SharePoint site.

Both these classes implement the IDisposable interface and best practice with .Net code generally is if a class exposes a Dispose method then you should always call that Dispose method to clean up any unmanaged resources the object might have used.

Not adhering to this best practice when using the SharePoint object model can hurt the performace of your site quite badly and when you realise how much more memory the unmanaged part of the object consumes compared to the managed part you will soon realise how important cleaning up them unmanaged reasources is.

Anyway the article goes into more depth so get over to MSDN and have a read.

http://msdn2.microsoft.com/en-us/library/aa973248.aspx

kick it on DotNetKicks.com


Popfly now open to all for beta testing.

October 19, 2007

 

A while back I posted about Microsoft Popfly, which is a very cool site from Microsoft that lets you create web pages and web ‘mashups’ without writing a single line of code.

At first Popfly was invitation only but Microsoft have now opened it up to everyone for Beta testing.

I’ve been wanting to play around with Popfly since I first saw a demo on channel9, so I went to the site, logged in and had a simple mashup up and running within minutes.

You can watch the latest Channel9 video on Popfly here to help you get a better understanding of the product. 

When you get into the designer you will notice a toolbox to your left that contains lots of Microsoft and user generated ‘blocks’

Popfly blocks are the foundation of building mashups and you can create your own using javascript, I used two of the pre-built ones to create mine.

I dragged on the Flickr block and entered my API key, what I liked about this was that the block automatically informed me that I need to generate and API key and also gave me a link so I could accomplish that very easily.

I then dragged on the Virutal Earth block and linked the Flickr to it.  I then needed to go into the settings of the Virtual Earth block and wire up the inputs from the Flickr block, in this case it was the latitude and longitude values from my geo-tagged Flickr photos.

I then saved this mashup and run it.

A there you have it, a fully working mashup that was created without writing a single line of javascript. Of course you can build you own blocks and go much further with some very sophisticated mashups and your Popfly projects can also be integrated within Visual Studio.

I think you will agree that this is a very fun and creative tool from Microsoft, I hope it takes off.


Scott Guthrie’s presentation on new MVC Framework

October 12, 2007

Scott Hansleman posted this video recorded from a recent ALT.Net conference.

Scott Guthrie demo’s the new MVC Framework from Microsoft which uses the MVC Front controller pattern that Ruby on Rails people would be familar with.

I definately recommend watching the presentation it’s 60 minutes long but well worth it.

I’m undecided on the Framework yet until I get to play with it, but I do know that introducing a more disiplined, structured way of developing web applications with .Net is a good thing.


How they know you know…

October 9, 2007

Not to have the same letter twice as a shortcut key in a context menu :D

I actually noticed this a long time ago, but have only just got round to posting it up, did make me chuckle a bit.


MIX:UK 07

September 13, 2007

On Tuesday I attended the first day of Mix UK 07. Sadly I couldn’t attend the second day due to work commitments but I learned enough about Silverlight from the first day to say it’s was a very informative and useful conference.

All the attendees recieved a free 1GB USB stick which contained a slick Mix Reader application for viewing Mix content.
Scott Guthrie hosted the keynote in which we was shown some fantastic demo applications built on Sliverlight 1.1 Alpha.

George Moore who is General Manager for the Windows Live Platform at Microsoft showed us an AventureWorks application built on top of Windows Live QuickApps Beta.

Sentient showed us their http://www.trackme.com/ application which is currently not live yet. TrackMe is a cool Silverlight and Virtual Earth app that hooks into your Windows Live contacts and allows you to track where your friends are, it sends you a text message when your friends are nearby. A cool concept and a good use of Microsoft technology.

EasyJet presented their new holiday website http://holidays.easyjet.com/. EasyJet have teamed up with First Choice to provide their customers with a complete package holiday experience and have developed this great ASP.Net AJAX website that also makes excellent use of the Virtual Earth API.

TwoFour Digital (http://www.twofourdigital.com/) gave us a lookat their new Silverlight media player created to stream government content.

DotNet Solutions (http://www.dotnetsolutions.ltd.uk/main/) showed off their cool Scrum wall Silverlight app which is basically an interactive Scrum wall that allows development teams to manage software projects in their browser. The cool thing about this app was that it uses Microsofts Direct Push technology which allowed the changes in one persons browser to be synced into all other browsers.

Finally Sage showed us a cool (if tax returns can be cool) Silverlight online tax return form.

After the keynote I stayed around for Scott’s session’s on building Silverlight 1.1 applications with .Net. These sessions were very useful and definately pointed me in the right direction to start building my own apps.

The slide from Scott’s sessions can be downloaded over at his blog here


Vista SP1 Beta scheduled for next few weeks

August 30, 2007

The Vista Team have annouced that there will be a Beta available of first Service Pack for Windows Vista in the next few weeks.

They have released a white paper detailing what will be included in the service pack which can be read here:

Vista SP1 Beta White Paper


Creating a Templated User Control with ASP.Net 2.0

August 11, 2007

We all know the benefits of re-usable components in our applications and User Controls in ASP.Net are an easy way to build reusable components that can be used throughout an entire web application.

Templated User Controls allows us to seperate the controls data from it’s presentation because a Templated User Control does not provide a default user interface.

For example I will show you how to create a templated address control thats allows you to reuse address fields across your web application but leaves the formatting up to the individual page designer to style how they wish.

First we open a new web application in Visual Studio and add a new Web User Control to our solution.

We then add a PlaceHolder control to the User Control which will act as a placeholder for our controls rendered data. Our controls markup looks like this:

Next we switch to our controls code behind and implement all the properties we need for our address control plus one other property that returns a type of ITemplate. Our code behind looks like this:


Now we need to create a container class that will act as our naming container and exposes all the properties of the User Control to the host page. The container class needs to inherit from the Control class and implkements the INamingContainer interface. The class looks like this:

We need to put the following code inside out controls Init event to instantiate our container class and set its properties, instantiate a copy of the controls ITemplate inside the container control and add our container control to the PlaceHolder’’s controls collection.

Now we have a fully working Templated User Control we can put this control onto any web page within out web application and set its data. The markup below shows how this is done:

And thats it!

If you want to do the same as this but package the control up into an assembly that can be reused across multiple web applications you need to create a control that inherits from the Control or WebControl class.

kick it on DotNetKicks.com


Registered to attend Mix:UK 07

August 9, 2007

Just registered myself over at the Mix:UK 07 site. Thoroughly looking forward to attending the event it should be a very informative couple of days.

I’m especially looking forward to Scott Guthries keynote.

If you want to attend, make sure you register on the site before the 10th August to get a £100 discount.


Vista Pre-SP1 Updates

August 8, 2007

Microsoft have released two performance and reliability patches for Vista which can be downloaded from the links below:

 http://support.microsoft.com/?kbid=938194

 http://support.microsoft.com/?kbid=938979

These patches will be rolled up into SP1 which is apparently due soon, so you only really need to install the above patches if you are having hardware or performance issues.