Chris McGrath’s Blog

Just another Developer’s Blog

Posts Tagged ‘Wish

Application Data

leave a comment »

I’ve never really got Window’s AppData concept. Local, LocalLow and Roaming. What the hell do they mean. Admittedly, I haven’t bothered researching it much, but to me how it should be handled is quite clear.

Some background…

I’m a big believer of 2 partitioned systems – the system partition and the data partition.

The System partition holds the windows files and program files, while the data partition obviously holds data including the desktop and documents folder. The most important part of the system partition is that it should be treated as volitle – I should be able to format it at any time and not lose any data.

This makes it great for create an image of the drive – if something goes wrong, I can restore it and have a fresh install without losing any data.

There is one problem with this and that’s the AppData.

From the name AppData you’d think that it should belong on the data partition. And definitely some does belong there, but it is used for so many other thing that could potentially be causing the problem you want to restore your image to get rid of. As such we have to leave it on the system partition.

And how it should be done…

AppData should be treated to support this distinction between Applications and Data. So AppData should be divided into…

  • Volatile App Data
  • Non-Volatile App Data

Volatile App Data would remain on the system partition and Non-Volatile on the Data Partition.

A great example is a web browser. A web browser has temporary internet files since they are temporary they are volatile. But they also have bookmarks which the user will want to keep. Also I want to keep a history of where I have been so that should be non-volatile.

This system is very clear what the meanings are. It is also an important step in what I consider a critical issue – the standardisation of the 2 partition system.

Advertisements

Written by Chris McGrath

July 26, 2009 at 12:21 pm

Posted in Blog

Tagged with , ,

In value set

leave a comment »

One thing which I quite often wish C# had a clean way to say if a variable is equal to one of many values.

Traditionally we’re stuck doing

myVal == 5 || myVal == 8 || myVal == 100;

we could say

new [] { 5, 8, 100 }.Contains(myVal);

but to me this doesn’t allow your intent to be read nicely. In fact, it just seems the wrong way around.

What we need is something like SQL’s in. so I could say

myVal in (5, 6, 100)

that reads much better. I remember that Delphi also had a similar command.

Written by Chris McGrath

July 9, 2009 at 3:38 pm

Posted in Blog

Tagged with , ,