Bitter Coder
sour code and astringent experiences
Monday, July 28, 2008
Last 2 architecture chat writeup's
This is a writeup for the last 2 architecture chats - both were pretty free-form, with little of the topics mentioned in the posts getting much discussion as we all had own things to talk about!
As a brief summary:
Plenty of talk about Lightweight code-gen and run-time vs. post-compile IL weaving, debugging integration etc. Hard to cover all the little facets that were explorer - but it's been interesting - it seems like more developers are starting to dabble with IL.
We talked about approaches for introducing cross-cutting behavior such as versioning and history to your data access and approaches for flowing metadata from your domain model up to the UI (including searching, validation etc.) and ways to index, query and flow the information across boundaries in the application.
As a tangent to this I've been talking about how I've been using MDA/MDG to drive the domain model generation (including things like validation, search annotations etc.).
We talked about the recent S3 outages and approaches for placing resources on both European and US data centers simultaneously, and possible ways to mitigate the double-upload bandwidth costs.
Discussions (sparked originally from a email discussion on the NZ dotnet user group) around hiding the implementation details of your ORM from the rest of your application - and the practicalities of how deep this needs to go, using linq through boundaries etc.
Discussions around injecting logic into generated source code, both in asp.net/winforms generated code as well as possible ways to intercept custom tool generation so you could manipulate the output.
Spartan programming
got a mention - Peter felt it aligned with alot of his current coding style.
Embedding
NHaml
as a view engine in non-MVC applications, and the general experience with different view engines including
Brail
,
ASP.NET
MVC's default ASPX View engine etc. (Including the error reporting and debugging experience) - We also talked briefly about the
Spark view engine
, which looks to be like it could be quite palatable to non developers while still offering a useful syntax for developers.
If anyone has any topic suggestions for next weeks chat just leave a comment on this post or flick me an email.
architecture chat
posted @ Monday, July 28, 2008 6:38:09 AM (New Zealand Standard Time, UTC+12:00)
Comments [5]
|
Trackback
|
Wednesday, July 30, 2008 8:42:16 AM (New Zealand Standard Time, UTC+12:00)
That's an interesting set of topics Alex. I'll have to try and remember them for our next Wellington architecture chat ;-)
By the way, a couple of topics from the Wellington scene, which might be of interest since they relate to the topics you mention:
- Regarding customising the output of generated tools, check out
Reegenerator
. It's a local NZ product, and it gives a really nice way to intercept code generation from custom tools. Bascially, it lets you use the existing DataSet and LINQ-to-SQL design surfaces, but it replaces the custom tool with an equivalent one that has customisable source code. There's a video on the site that shows how it works. I've seen the author demonstrate it in person, and the seamlessness of the IDE integration was really impressive.
- I missed the .NET UG discussion unfortunately, but I wonder if
this page
on abstracting LINQ to SQL (for test purposes) but may be relevant to your topic too
John Rusk
Friday, August 01, 2008 12:59:43 PM (New Zealand Standard Time, UTC+12:00)
You can watch how to customize the designers generated code at
http://www.reegenerator.com/ShowVideo.htm?video=Replace.swf
The video will show you how it works and then how easy it is to start building a LINQtoSQL code generator that gets invoked by the LINQtoSQL default designer.
You can download the code generators at
http://www.reegenerator.com/TemplatesGallery.htm
. You will get replacements for LINQtoSQL, Dataset, Resources and Settings designers (C# and VB). All the renderers emulate the default behaviour in order to offer you a familiar starting point for any customization you want to implement.
kodeo
Monday, August 04, 2008 7:44:00 PM (New Zealand Standard Time, UTC+12:00)
kodeo: It looks like reegenerator just allows me to replace the code generated with my own template - ideally we were discussing retaining the existing generator (mostly for 3rd party products, where the generator or the source XML etc. is too complex to write a simple template for) so that we could get hold of the original generated code, and then apply changes/transformations to it, perhaps by parsing it into an AST, before outputing it.
Alex Henderson
Monday, August 04, 2008 7:53:17 PM (New Zealand Standard Time, UTC+12:00)
John: We talked about Mocking/faking out contexts... I think some of problems weren't so much the data-based bound aspects but how to even test linq expressions in isolation i.e. it's easier to look at say an NHibernate criteria and see what your sorting by, skip/take etc. Doing the same with an Expression<IEnumerable<T>> isn't as much fun - for instance to ensure the correct query is being passed from a controller to a repository, without having to actually execute the query on some in-memory data, then verify the results were correct.
How's the Wellington geek chats going? more interest now that it's hosted somewhere quieter?
Alex Henderson
Tuesday, August 12, 2008 9:40:36 AM (New Zealand Standard Time, UTC+12:00)
Alex: retaining the existing generator is actually a trivial job with Reegenerator. The customized code generator would look something like:
public class PassItOn : Generators.CodeRenderer
{
public const string CustomToolName = "MSLinqToSQLGenerator";
public override Generators.RenderResults Render()
{
byte[] ctResults =
base.RunOtherCustomTool(CustomToolName)
;
string results = System.Text.Encoding.Default.GetString(ctResults);
return new Generators.RenderResults(results);
}
}
The RunOtherCustomTool method invokes an existing custom tool code generator and returns the results that would have otherwise been saved in the .Designer.cs file. Once you have the results you can parse and alter them in any way you like and pass the results back to Visual Studio to be saved instead of the original.
The example solution from the Customize Standard Designers Generated Code section of the
http://www.reegenerator.com/TemplatesGallery.htm
template gallery page, contains a class named PassItOn in the CustomizeDesigners project. The code is similar to the code above but with comments and with constants defined for LINQtoSQL Settings, Resources and Datasets.
If you have a specific problem in mind, let me know. We might be able to draft a solution in less than 10 minutes.
kodeo
Comments are closed.
© Copyright 2008 Alex Henderson
Theme design by
Bryan Bell
newtelligence dasBlog 1.9.6264.0
| Page rendered at Saturday, November 22, 2008 8:55:24 AM (New Zealand Daylight Time, UTC+13:00)
Search
FeedCount
Tags...
.Net (82)
.Net Reactor (4)
.net user groups (9)
2008SummerRoadTrip (1)
ActiveRecord (1)
architecture chat (54)
ArchitectureCamp2007 (2)
asp.net (1)
Astoria (1)
Auckland (1)
base4 (9)
batching (1)
binsor (1)
blog (4)
books (1)
C# 3.0 (9)
cambodia (9)
CAML.Net (1)
castle (39)
china (8)
codecamp (2)
codeplex (3)
dapper.net (1)
DevDefined Ltd. (4)
DirectShow.Net (1)
DLR (1)
DSL (3)
EAUG (1)
Enterprise Architect (5)
Enterprise Library (1)
F# (1)
feedburner (2)
Friendster (1)
generics (1)
googlegears (1)
hacks (3)
hardware (3)
hongkong (2)
hyper-v (1)
ideas (1)
IoC (21)
IronPython (13)
IronRuby (2)
jobs (1)
Languages (2)
laos (8)
LINQ (7)
LiveId (1)
LLU (1)
Local Government (1)
MDA (1)
MDD (1)
microsoft (1)
Model Driven Development (1)
mono (1)
monorail (2)
Movies (1)
Music (1)
nDepend (1)
news (1)
NHibernate (2)
NUnit (2)
nvelocity (1)
OAuth (6)
office (1)
OpenSocial (1)
orcon (1)
photos (1)
php (1)
PostSharp (1)
powerpoint (1)
presentations (1)
ReSharper (1)
REST (2)
rhino commons (2)
rhinomocks (5)
Ruby (1)
SaaS (1)
scm (1)
Screen Architect (1)
SharePoint (5)
silverlight (1)
Splicer (4)
SQL2008 (1)
supcom (1)
svn (1)
Syzmk (4)
thailand (6)
Tools (2)
Tortoise SVN (1)
trac (2)
Travel (36)
Unity (2)
vietnam (7)
vista (2)
vmware (1)
volta (3)
VS2008 (1)
WCF (3)
wiki (2)
wikipedia (1)
Windows Server 2008 (1)
windsor (6)
WinForms (1)
wix (2)
WPF (2)
xmlrpc (1)
yahoo pipes (1)
Who am I?
Alex Henderson
Auckland
, New Zealand
Managing Director at
Dev|Defined Limited
"Self Confessed Coding Junky for 15 years"
Mobile:
+64-21-402-969
Email:
bittercoder 'at' gmail 'dot' com
MSN:
bittercoder_nz@hotmail
Skype:
alex.devdefined
Navigation
My Bookmarks (Delicious)
My GoogleReader - shared items
My Photos on Flickr
My Wiki
Catch NZ Limited
DevDefined Limited
tools.devdefined.com (Trac site)
New Zealand DotNet User Group
Screen Architect
Seismic Technologies (Syzmk)
Splicer - The .Net Video Splicing Library
On this page....
Blogs I read by New Zealanders...
Alex James
André Meurer @ Olympic Software
Andrew Dixon
Andrew Peters
Bennie Johnston
Blog:: Craig Pringle
Blogging is probably just a fad, but just in case...
Buzzrick's TileEngine Game Platform
Chris Auld
Chris Crowe's Blog
Chris Johnson
Clifton Johnston
Code Climber
Craig Box
Daniel
Daniel Wissa
Darryl Burling
Dave Dustin
Duncan Bayne
Floyd Burgess
Gabriel Smith
Geekzone blog
Grant Archibald
Grant Drake
Ivan Porto Carrero
Ivan Towlson
Jeremy Boyd
Jithen Singh
John-Daniel Trask
Josh Hektor
Juha Saarinen
Keith Nicholas
Kevin Daly
Mark Rees
Maruis Marais
Mauricio Freitas
Mindscape
My Blog (Alex Henderson)
Nathan Mercer
Nic Wise
Nick's Blog
Nigel Parker
Paul Andrew
Paul Lo
Peter Jones
Phil Cockfield
Public Address
Rod Drury
Sean McBreen
Simeon Pilgrim
Software Development and stuff
Stefan Schulz
Steve Schapel
Steven Kempton
The Blog of Dave5
The Book Diary
The Voice Of Reason New Zealand
Thoughts from Mirality
Tim Haines
Blogs I read on Castle...
Andrew Hallock
Ayende
Brian Romanko
Dan Bunea
Dru Sellers
Eleutian SpeakENG Development Blog
Gabriel Schenker
Hamilton Verissimo
Insane World
Insert Catchy Title Here
Jeff Brown
Ken Egozi
Marc-André Cournoyer's blog
Matt Berther
Nick Parker
Roy Osherove
Roy Tate
Technorati: http://castleproject.org
Wendy Friedlander
BlogMap
Del.icio.us
Wishlists
Sign In