Blog posts page 22 of 44

Multiple-inheritance, composition and single responsibility principle in .NET

  • ๐Ÿ“…
  • ๐Ÿ“ 854
  • ๐Ÿ•™ 4
  • ๐Ÿ“ฆ .NET
  • ๐Ÿ’ฌ 5

.NET is often chided by C++ developers for failing to support multiple-inheritance. The reply is often Favor object composition over class inheritance โ€“ a mantra chanted from everywhere including the opening chapters of the Gang of Fourโ€™s Design Patterns book.

If the accepted mantra is that your object should expose interfaces and delegate the implementation of those interfaces elsewhere then it could really do with some better support than .NET currently offers especially where the interface comprises more than a member or two.

Typed session data in ASP.NET made easier still

  • ๐Ÿ“…
  • ๐Ÿ“ 289
  • ๐Ÿ•™ 2
  • ๐Ÿ“ฆ .NET
  • ๐Ÿ’ฌ 5

Philippe Leybaert is unimpressed with Microsoftโ€™s Web Client Software Factory approach for typed session data and offers his own Typed session data made (very) easy which still seems overkill to me comprising as it does of generics, a delegate a helper class to achieve the desired effect. (Whilst you are there check out his very interesting MVC project for ASP.NET called ProMesh)

The solution which I have been using since my .NET 1.1 days is much simpler still and involves nothing more than creating a plain class with properties for every session variable and a static get accessor that obtains or creates it on the HttpContext similar to a singleton.

Windows Mobile 6 on the HTC TyTN with a Mac

Windows Mobile 6 on the HTC TyTNItโ€™s been a while coming but HTC have announced Windows Mobile 6 for the TyTN (Hermes, Dopod 838Pro, iMate JASJAM , SoftBank X01HT).

Curiously the update isnโ€™t available on their site yet despite the announcement however the enterprising folks at XDA Developers Forums have made the official HTC versions available for download.

Partial methods in .NET 3.5, overview and evolution

  • ๐Ÿ“…
  • ๐Ÿ“ 473
  • ๐Ÿ•™ 3
  • ๐Ÿ“ฆ .NET
  • ๐Ÿ’ฌ 1

One of the interesting new things in .NET 3.5 is partial methods which are now being used extensively by LINQ to SQL and no-doubt will be Microsoftโ€™s corner-post of extensibility for generated classes. Hereโ€™s a quick overview:

When inheriting from generated classed designers often provide virtual methods for you to override and extend at a cost of being forced to inherit from the generated class instead of one of your own choosing. e.g.

Importing BlogML into WordPress

Iโ€™ve been trying to get my content out of Subtext and into WordPressย โ€“ a process that shouldnโ€™t be difficult however Subtext only supports the blog-independent BlogML format and whilst WordPress supports a number of import formats BlogML isnโ€™t one of them. For export WordPress only supports itโ€™s own WordPress WXR format although the BlogML guys have an exporter available.

The first idea was toย put together an XSL transform to convert BlogML to WXR.

Rails-style controllers for ASP.NET

  • ๐Ÿ“…
  • ๐Ÿ“ 610
  • ๐Ÿ•™ 3
  • ๐Ÿ“ฆ .NET
  • ๐Ÿ’ฌ 1

Rob Conery has been putting together some great screen casts on SubSonic and his latest on generating controllers pointed out that ASP.NET doesnโ€™t support the Rails-style http://site//controller/method style of execution.

This got me quite excited and Iโ€™ve put together a proof-of-concept web project that demonstrates mapping the path to controller methods using an IHttpHandlerIHttpHandler and reflection.

Hidden menu options on the Mac

  • ๐Ÿ“…
  • ๐Ÿ“ 646
  • ๐Ÿ•™ 3
  • ๐Ÿ“ฆ Apple

Apple tends to hide away unusual functionality in order to keep the user interface easy to use.

Here are a few hidden menu options that magically appear when you press the ShiftShift, AltAlt or CtrlCtrl modifier keys.

What are you doing for the next 6 months to be a better developer?

Scott Hanselman posed the open question on his Hanselminutes podcast and there have already been some good responses. My own plan includes:

My girlfriend gave me the well-regarded Code Complete, Second Editionfor my birthday. I shall read it cover to cover and adopt good practices I am not currently practicing.

Italic syntax highlighting in Visual Studio 2005

I came across a posting by Thomas Restrepo about a theme for Vim he likes called Wombat and how it wouldnโ€™t be worth porting to Visual Studio as it doesnโ€™t support italic syntax highlighting โ€“ as we all know.

This got me thinking and I was able to port it with italicswith italics although the process is a bit of a hack.