GreenRock Software Code Comment

May 28, 2008

Strange Operators

Filed under: New Posts, Ramblings — greenrocksoftware @ 11:43 am

private string GridViewSortDirection
{
get { return ViewState["SortDirection"] as string ?? “ASC”; } // if the value is null then return “ASC”
set { ViewState["SortDirection"] = value; }
}

See more here

May 2, 2008

USB Drives Letters

Filed under: New Posts, Ramblings — greenrocksoftware @ 7:30 am

My USB flash drive went AWOL after I added a new USB hard drive.

When a USB drive is first attached, Windows allocates it the first available drive letter even if the letter is an existing network share. This is because XP network shares are specific to the current user and not visible in the context of the system where the letter is assigned. The USB drive then appears to be invisible.

The resolution is to give the flash drive a new drive letter i.e.

1. Right click My Computer then Manage
2. Select Disk Management
3. Right click on the troublesome USB disk
4. Use Change Drive Letter and Paths to give it a new drive letter

If you are still getting grief have a look here for a tool to help you manage your USB drive allocations.

And one more thing since I first posted this .. there is a limitation to what drive letter you can assign a USB drive to … its around F(ish).

April 16, 2008

WCF with LINQ

Filed under: New Posts, Ramblings — greenrocksoftware @ 10:30 am

From Chris comes this. Interesting how the WCF layer passes through entities from the GUI or from afar.

April 13, 2008

MVP Gripe #258

Filed under: Javascript, New Posts, Ramblings — greenrocksoftware @ 6:48 am

As I hear yet another colleague complain about the complexity of MVP – “its just pathetic” – I’m starting to think things have gone wrong – badly wrong!

We are NOT rocket scientists and its only a web form!

The aim of MVP is:
– Testability of the application
– Cohesion or separation of responsibility
– Enable the conceptual design to be changed with minimal impact to the entire application.

The advantages are:
– Separation means UI, business logic and data access developers can work independently.
– The presenter can be reused in different user interface designs (web, windows form, etc).
– Maintenance is easier due to separation of responsibilities (UI, application behavior, and domain).
– Enables applications to support different user interface types – forms or web services.

So a simple tiered design with a UI Interface and Business, DAL and Service layers will largely achieve these objectives. So that makes MVP all about the “Testability” point – is THAT what this is about!

So we can’t NUnit test everything below the GUI! No big deal, lets give the test team a key stroke emulation tool to cover that issue and give the developers their weekends back.

Simple is good and MVP is coprolite.

April 10, 2008

Test of ScribeFire Access

Filed under: New Posts, Ramblings — greenrocksoftware @ 10:08 am

My version of the Super 14 table

35034 thumphris
Terry Humphris 18 241 Crusaders
36812 nard
Adrian Fletcher 21 240 Crusaders
[x]
62861 westy_nz
Chris West 18 229 Hurricanes
[x]
80317 cymraeglass
S Carter 26 221 Crusaders
[x]
96088 Gunn@rs
Ian Brown 15 212 Highlanders
[x]
101433 FishOfPrey
Daniel Ballinger 18 208 Hurricanes
[x]
102845 madhump
Patricia Humphris 18 207 Crusaders
[x]

March 30, 2008

LINQ to SQL Ain’t No Picnic

Filed under: New Posts, Ramblings — greenrocksoftware @ 12:38 pm

LINQ to SQL is not the panacea of all things development!

I never thought it would be but you always have hope – and somewhere in the back of your mind ….

Have a look at the handling of foreign key tables when inserting into a connected table.

I just want to insert a record ..

March 27, 2008

Subversion Plugin for – -VS2009

Filed under: New Posts, Ramblings — greenrocksoftware @ 7:48 am

A free plugin that integrates subversion into VS2008 and prior versions.

Ian is currently testing this so get feedback from him.

And out of the blue, the home of Scott Guthrie for good measure!

March 17, 2008

Link to Everything: A List of LINQ Providers

Filed under: Ramblings — greenrocksoftware @ 8:31 am

This is another one from Paul – LINQing to just about anything

Turns out Paul is not just a pretty face.

March 12, 2008

Microsoft ASP.NET MVC Videos

Filed under: Ramblings — greenrocksoftware @ 8:37 am

Chris has found these online screenings .. looks like an hour or so to watch them.

It seems one hand of Microsoft gives you RAD while the other gives you SAD!!

March 11, 2008

The DAL, LINQ and where to next

Filed under: Ramblings — greenrocksoftware @ 4:03 am

In developing software we endeavor to follow the SOA or “Service-Oriented Architecture” approach. SOA is an approach one might take as opposed to mindlessly writing code to meet an end objective. SOA allows orienting our design towards interoperability and reuse. The main concepts of SOA are:

Reuse and composition: Share modules between applications and inter-application interchanges.

Permanence: Support current and future technologies.

Flexibility: Ensure applications can be enriched with new modules to answer new business needs.

Openness and interoperability: Enable modules to be shared between platforms and environments.

Distribution: Enable modules to be remotely accessed so that they can be centralized

Performance: Ensure scalability.

The new challenge is to incorporate LINQ and Entities into this philosophy BUT without creating the bloatware we see in implementations like Model – View – Presenter.

The DAL and LINQ

The use of the Data Access Layer and our traditional approach must now be questioned with the emergence of LINQ. We could say that LINQ itself is the DAL – but have a problem with this approach in that we may not wish choose to use LINQ for data access i.e. the data access technology should not be visible to the upper layers.
The discussion continues … perhaps this approach LINQ to SQL

There are some good web references to LINQ but Scott Allen has managed to bundle all the new technologies in one small demo application

Blog at WordPress.com.