Archive

Archive for the ‘Uncategorized’ Category

User Experience : “Because that’s where the money is.”

July 27th, 2010

After years of development and architecture, my concerns have shifted to user experience. Why? Well I think Willie Sutton (the bank robber) had it down… Focus on what you are after.

Software is about users…

 

Books I recommend:

> Rework : As Seth Godin puts it, “ignore this book at your own peril.” This comes from the guys at 37signals, and it has changed my approach to software design. 

image

> About Face: This is a fantastic book with significant depth and yet very readable.

image

> Don’t Make Me Think: This is a good book, a good intro perhaps, but a bit basic. Still it’s a classic and well deserves it’s place on the list.

image

 

> Communicating Design: Developing Web Site Documentation for Design and Planning good but not very fun to read.

image

alan.huffman Uncategorized

More Top Notch & Useful Web Resources

July 20th, 2010

I’ve been focusing more and more on UX & Design recently (though my hand is still stuffed up the backside of ASP.NET MVC 2 & C# & EF &… )

 

JQuery Plugins (of course)

 

Color Tool Tips http://tutorialzine.com/2010/07/colortips-jquery-tooltip-plugin/ 

image

Various apps & plugins : http://www.zinescripts.com/

image

 

Dot Net

TownCrier – an email templating engine http://thecodedecanter.wordpress.com/2010/07/19/town-crier-an-open-source-e-mail-templating-engine-for-net/ 

 

Web Stuff

 

Tileable Textures (very nice)

http://tileabl.es/

image

 

 

10 Tips for designing Mobile web sites

: http://labs.thesedays.com/2010/07/16/10-tips-for-designing-mobile-websites/

 

 

Resize your browser

: http://resizemybrowser.com/

image

 

5 Web Files That Will Improve Your Website

 http://sixrevisions.com/web-standards/5-web-files-that-will-improve-your-website/

 

960 Grid made easy:

http://sixrevisions.com/web_design/the-960-grid-system-made-easy/

alan.huffman Uncategorized

Must know Visual Studio 2010 KeyBoard Short cuts & tricks

March 14th, 2010
Name Short Cut Result
Macro: [1] Ctrl+Shift+R
Ctrl+Shift+R
Ctrl+Shift+P
Record a new temporary macro
Stop recording macro
Play the recorded macro
Multiple Copy / Paste [1] Ctrl+Shift+V cycle through clipboard
Navigate to Prev/Next Cursor [1] Ctrl+- Previous Cursor Position / Next
Matching Brace [1] Ctrl+]
Ctrl+}
Navigate to previous brace
Opening Various Windows [1] Ctrl+Alt+O
Ctrl+Alt+K
Ctrl+Alt+L
Output Window
Task List
Solution Explorer
Bookmarks [1] Ctrl+K, Ctrl+K
Ctrl+K, Ctrl+N
Ctrl+K, Ctrl+P
Ctrl+K, Ctrl+L
Create/Remove Bookmark
Move to Next Bookmark
Move to previous
Clear all bookmarks
Commenting [1] Ctrl+K, Ctrl+C
Ctrl+K, Ctrl+U
Comment Block
Uncomment Block
Full-Screen Coding Window [2] Alt+Shift+Enter Hides all windows except for coding window
Toggle Outlining [2] Ctrl+M+M Expand / collapse a outline of code
Kill Line [2] Ctrl+L Kills (deletes) entire line
Code Snippets [2] Ctrl+K+S Access Code Snippets (if, region, etc..)
Fuzzy Navigate To [2] Ctrl+, Navigate To Search
Stop Debugging Shift+F5 Stop debugging
Find Usages Shift+F12 Find usages
Create Property type “PROP” + Tab + Tab Creates a new property

 

Sources:

[1] http://www.codeproject.com/KB/tips/VSnetIDETipsAndTricks.aspx

[2] http://www.itscodingtime.com/post/Visual-Studio-2010-Keyboard-Mouse-Shortcuts.aspx

alan.huffman Uncategorized

Web Dev : Must haves for WCF 4.0 REST Services & ASP.NET MVC Rc2

March 1st, 2010

Do your self the favor of learning WCF even if you don’t use it – b/c MVC & WCF are using lots of the same components.

This blog series is amazing: http://blogs.msdn.com/endpoint/archive/2010/01/06/introducing-wcf-webhttp-services-in-net-4.aspx

> Especially (IMHO) this blog on ROUTES: (used in MVC & WCF 4.0) : http://blogs.msdn.com/endpoint/archive/2010/01/25/using-routes-to-compose-wcf-webhttp-services.aspx

 

Beyond that, if you are using ASP.NET MVC RC2… well you need a book, and Jeffrey Palermo has been writing one that you can help him edit on : GIT

> http://github.com/jeffreypalermo/mvc2inaction

 

Learn, Build, Reap.

alan.huffman Uncategorized

MIME-Types [content-types] :: Cheat Sheet for REST

January 19th, 2010

http://en.wikipedia.org/wiki/Internet_media_type

 

  • Type x: Non-standard files[10]
    • application/x-dvi: Digital Video files in DVI format
    • application/x-httpd-php: PHP files
    • application/x-httpd-php-source: PHP source files
    • application/x-latex: LaTeX files
    • application/x-shockwave-flash: Adobe Flash files; Documented in Adobe TechNote tn_4151 and Adobe TechNote tn_16509
    • application/x-stuffit: StuffIt archive files
    • application/x-rar-compressed: RAR archive files
    • application/x-tar: Tarball files
  • Type x-pkcs: PKCS standard files
    • application/x-pkcs12: p12 files
    • application/x-pkcs12: pfx files
    • application/x-pkcs7-certificates: p7b files
    • application/x-pkcs7-certificates: spc files
    • application/x-pkcs7-certreqresp: p7r files
    • application/x-pkcs7-mime: p7c files
    • application/x-pkcs7-mime: p7m files
    • application/x-pkcs7-signature: p7s files

alan.huffman Uncategorized

HTTP Codes for Rest [ CHEAT SHEET ]

January 19th, 2010

Symbolic Links [ MKLINK ] in Windows :: A “Must Have” tool!

January 19th, 2010

If you have ever used linux and currently use windows, you probably miss the ability to create symbolic links, hard links, etc.. between 2 directories or files.

The idea being that where a file is logically located should be independent of where it is physically located.

Example, let’s say you have some JavaScript or HTML files located in one project that you want to share with another. DRY (don’t repeat yourself) forces you to the realization that you do NOT want to COPY / PASTE. So you could just put the files in one directory and LINK to it from the other.

Read about it: This is the best article I found.

http://www.howtogeek.com/howto/windows-vista/using-symlinks-in-windows-vista/

 

Here is the technical bit:

http://technet.microsoft.com/en-us/library/cc753194%28WS.10%29.aspx

 

Mklink

Updated: April 25, 2007

Creates a symbolic link.

For examples of how to use this command, see Examples.

Syntax

Copy Code

mklink [[/d] | [/h] | [/j]] <Link> <Target>

Parameters


Parameter

Description

/d

Creates a directory symbolic link. By default, mklink creates a file symbolic link.

/h

Creates a hard link instead of a symbolic link.

/j

Creates a Directory Junction.

<Link>

Specifies the name of the symbolic link that is being created.

<Target>

Specifies the path (relative or absolute) that the new symbolic link refers to.

/?

Displays help at the command prompt.

Examples

To create a symbolic link named MyDocs from the root directory to the \Users\User1\Documents directory, type:

Copy Code

mklink /d \MyDocs \Users\User1\Documents

alan.huffman Uncategorized

Anemic Domain Model Anti-Pattern

April 24th, 2009

We have built a brown field project, which is to say that it has some ugly architectural and coding attributes.

There are 2 mains issues with it.

  1. Low code coverage (unit tests)
  2. In many cases we implemented the Anemic Domain Model Anti-Pattern (see Fowler’s blog)

The issue, in part, is that LINQ psychologically pushed us in that direction (I think – or maybe I’m just making excuses).

This is an example, but we mapped out an architecture a few years ago that was along the lines of this simple tiered structure:

 image

** Note the use of “tbl” for tables & Entity objects is merely to reinforce their connection to the DB due to the 1 table –> 1 object mapping of LINQ. (I don’t use “tbl” in my tables)

All seemed well in the world. We happily went on our way creating partial classes for our tables.

First User Story: Determine the Order cost.

The solution seemed easy enough, loop through the order lines, add up each order line cost, and take the sum.

public Currency Cost( ){

    return this.tblOrderLines.Sum( ol => ol.Cost );

}

But then came the question of where to put this. Obviously OOP would push us to put .Cost() on the tblOrder object. But we faced two problems:

1) By naming the persistence layer as DAL Layer, psychologically we were averse to putting too much business logic there.

Perhaps the DAL layer *is* the Domain Object layer and by merely renaming the DAL Layer as Domain Layer, we would have felt better about it.

2) The second was that the tblOrder object didn’t have enough information to determine the total cost of the order. We had to add taxes, and the amount of taxes changed depending on the state and the type of the order_line.

The Order really needed access to DataContext in order to grab additional information from a tblTaxState table. This is were we made the mistake of putting the COST() into the OrderService

public Currency Cost(tblOrder ord, DBcontext db){

       tblTaxState st = db.tblTaxStates.Where(

                                 txSt => txSt.State == ord.Patient.State

                               ).First();

       Currency cost = new Currency();

        ForEach( var ol in ord.tblOrderLines ){

                    cost += ol.Cost + txSt.ApplyTax( ol );

        }

       return cost;

}

There are a number of ways we could have better solved this. We could have passed the tblTaxState to the tblOrder.Cost() method.

  tblTaxState st = db.tblTaxStates.Where(

                                 txSt => txSt.State == ord.Patient.State

                               ).First();

Currency cost = ord.Cost( st);

Or perhaps even better, would have been to merely pass the DBContext to the tblOrder.Cost() method

Currency cost = ord.Cost(db);

My question is whether that passing around of the DB Context to Domain / Entity objects *SMELLS*.

alan.huffman Architecture, Uncategorized , , ,