Showing posts with label book. Show all posts
Showing posts with label book. Show all posts

Thursday, May 26, 2011

Amazon Kindle

I recently bought a Kindle (v3). I bought the WiFi version (£111) as I don’t need the 3G connectivity. I also bought the Kindle Edition of Iain M Banks’ latest Culture novel Surface Detail. This cost £5, which is approximately the same as the paperback version.

I chewed through it in about the same time and manner as I would have done the dead-tree version. I was happily reading for hours at a time with no hint of eye strain. Due to its small size and weight and long recharge times it’s as convenient as a dead-tree book. As it’s not back-lit it doesn’t wash out in sunlight like a laptop does, so I was untroubled even when slashes of bright sunlight were coming in through a blind in the conservatory. There’s space for ~3500 books so that should mean I’m never without something to read – I’ll no longer have to pack a stack of books to take on holiday.

It remembers your place in each book, so it’s easy to switch reads. You can create additional bookmarks and highlight passages. It comes with a copy of the Oxford English dictionary so you can easily look up the meaning of new words.

There’s a vast stack of ‘classics’ available free from the Kindle website. I’ve often promised myself I’d read some of this stuff at some point, but now I can do so easily I’m left wondering if I really want to read Moby Dick (for example).

It has a built-in web browser, which I’ve not really used, and the Kindle can also read books aloud to you. This is surprisingly good, both at pronunciation and at emphasis. I’m not sure how much use it will be to me, but could be great (along with the dictionary) to help kids get into reading.

There’s a standard socket for ear phones and you can upload and playback MP3 tracks so you can have music along for the ride, although I’ve not tried this either yet.

I’d like to try a Kindle Edition computer textbook out soon – I’ve currently got a fair size backlog of dead-tree texts to get through, but they are so bulky and dry it’s often hard going. Being able to nibble away on a Kindle might be a much better way for me to keep up in future. And having them at hand when you need them (rather than stacked-up in an office) would also be good.

I’m not too concerned about the costs of eBooks at the moment - £5 for the hours I’ll get out of my first purchase seems a good deal to me – although I’m uneasy about not being able to lend or sell an eBook on. Copyright laws are based on preserving pre-digital markets: if I buy a chair (or a car or a whatever) I expect it to retain some value which can be recovered through sale. Having these rights artificially restricted seems wrong somehow.

Friday, August 13, 2010

ASP.Net MVC

Here is a brief summary of the first chapter of Professional ASP.NET MVC 1.0, which is freely available to download from http://tinyurl.com/aspnetmvc. Even though it’s only the first chapter, it’s a walkthrough of a worked example and, at ~180 pages, covers a lot of ground. It’s also available for Kindle and an updated version for MVC 2.

The core of it is the model, view & controller pattern. While this isn’t a new idea, it’s still an improvement on the traditional Forms approach. The Model represents the data objects. Views are screens/pages, etc. Controllers process user requests (via URLs for example) by performing actions in the model and responding with an updated view, for example.

Applying the MVC pattern means the framework can provide built-in support for additional features, such as:

  • Routing – controls how URLs map to controllers. This makes it easy to create and maintain Search Engine Optimised (SEO or ‘Google friendly’) URLs.
  • ActionLink & RouteLink helper methods – creates URLs appropriate for the controllers. Avoids manually generating anchor tags. Can also do redirects.
  • Authentication & Authorisation – can decorate the Controllers’ action methods with role names and have the framework enforce security.

Perhaps the biggest benefit is that it’s simpler to unit test due to the greater separation of concerns – the model abstracts the database access and, if mocked, the views and controllers can be tested without a database actually being present. The final part of the chapter provides a walk through of this using dependency injection and Moq.

Early in the chapter we get an introduction to Linq To Sql, an Object Relational Mapping (ORM) tool. This can be used to quickly create an object model from SQL tables.

Some other things demonstrated include:

  • Scaffolding – quickly create basic default views (CRUD pages, etc) from templates (.aspx files).
  • Extension methods – add a method to a class without actually altering the class.
  • ViewModel classes – helper classes that expose the parts of the model needed by a specific view. Prevents exposing the entire model to every view. The ViewModel is constructed by the controller from the model.
  • Master pages & partial views – master pages allow the site’s shell to be specified once, rather than repeated on each page. Partial views are for sharing bits of views and for breaking UI things up into simpler parts.
  • Pagination – how to retrieve subsets of large result sets.
  • AJAXjQuery & JSON – demonstrates how to make a lightweight call to the website using AJAX; uses a simple jQuery text-animation effect; and sends data to a page in JSON format.

Overall, I recommend it. While many of the subjects covered will each take a further book to cover in any depth, the chapter does provide an excellent overview.