| Home :: Admin | ||||||||||||||||||||
chris carter's web log |
||||||||||||||||||||
Balsamiq Mockups In Action9:16 AM Sunday Dec 28, 2008 Comments: 2Taaz6:57 PM Thursday Dec 25, 2008 Comments: 1Via Justine, I tried out Taaz, here are my results(click to enlarge): Joking aside, try uploading your own photo, there's a slick little process you have to go through to identify the points of your eyes, lips, hair line, etc, it's really pretty cool. OK...no more wine for me today. Object.ConvertTo5:32 PM Tuesday Dec 23, 2008 Comments: 0Is this bad?
Testing the usage looks like this:
ChangeType was stolen from http://aspalliance.com/852. That looks like this:
Inside HyperActive9:29 PM Monday Dec 22, 2008 Comments: 0I'm finally getting around to documenting how to use this thing. HyperActive is a tool I wrote to help generate Castle ActiveRecord classes by inferring details from a database schema. Hyperactive uses my SchemaProber to read a database schema, and the Dominator helps with generating the code. Step 1: Download the CodeThe latest release is 1.3.1.9 and can be downloaded here. Step 2: Create the HyperActive Config FileHere is a config file for setting up HyperActive to run against the Northwind database running on your local system:
Things you need to provide. namespace, all of your generated classes will be contained in this namespace. outputpath is where the generated files will be saved; it can be relative to your project or absolute, in the config above I've chosen to go with a directory relative to my project's root. I like putting generated files into their own directory. Most of the time I generate partial classes and into the Data/Generated directory and then if i choose to extend any partial classes, I'll put those in the Data directory. basetypename indicates what generic class the generated classes will subclass. There are several ways of handling this, most of the time I use ActiveRecordBase Components... I ended up rolling my DI Framework. Mostly it was because I needed to minimize dependencies on other frameworks but also because I wanted to see what it takes to make a my own dependency injection tool. It was fun, brings up a good point though, how do you do dependency injection without having to also include Ninject, Windsor, StructureMap, or whatever the cool framework of the day is. The different components that can be swapped out, are the NameProvider, SchemaProvider, and the ActiveRecordGenerator implementation. There are some included in the HyperActive assembly or you can roll your own. Step 3: Setup Visual Studio External ToolsI have directory located at C:\lib where I put common libraries that I reference alot. Assuming that the HyperActive and hactive assemblies are located in that directory you can set up an external tool in Visual Studio with the following configuration: Step 5: Got Database?I know this works with the Northwind database. You can download my script from me here or grab the installer from codeplex or use your own database. Step 6: Set Up Your Solution and Generate!I'm going with a picture is worth a thousand words. Here's what the solution looks like before code gen: After code generation, we'll have this: The generated Products class looks like this:
Step 7: Take It For A SpinSo to test out our generated code, I added a nunit test fixture that just does a simple query for a specific product. That code looks like this:
Thoughts and CautionOK. So the caution part of this has to do with how I do databases. HyperActive, in it's current form, supports how I and my co-workers slash colleagues currently develop databases. This may differ drastically from the way you the reader develops against a database. I almost always use sql server 2005+ and identity columns. HyperActive will most likely puke on schemas that have tables with non-identiy column primary keys. HyperActive is not as flexible as it needs to be. Frameworks should be easy to extend if you are not the orginal developer. HyperActive is easy to extend if you are me or really bored and feel like working through the framework's source, so to that end I need to refactor and simplify. So anyway, there it is, I may have some more posts on this, but I have better ideas on how to improve it, so I might spend more time doing that. The CodeGet it all right here http://panteravb.com/downloads/HyperActiveNorthwindSample.zip. Unit Testing NHibernate and Castle ActiveRecord With SQLite6:0 PM Thursday Dec 18, 2008 Comments: 0NOTE: This is about a topic that is NOT a new concept, only new to me. As I'm working through incorporating S#arp Architecture ideas into my own architecture strategery, today(well, starting yesterday) I made the transition to using SQLite for unit tests. There's not alot to add to the code I scraped from the web. I started with using straight up ADO.NET and trying to create a table, do an insert, and query it. Then I moved into some code based on Ayende's post here to get NHibernate tests working. I then moved on to Brian Genisio's ActiveRecord testing sample to get ActiveRecord testing under way. Way cool. Here's my test test project. It should work straight out of the gate, but lemme know if it doesn't(it's a 2.4 meg download, VS2008 SP1, latest code from Castle trunk). I've included the SQLite .NET wrapper downloadable from here. Sock And Awe5:29 PM Wednesday Dec 17, 2008 Comments: 0This is awesome: http://play.sockandawe.com/ Eva's a Bitch11:11 AM Wednesday Dec 17, 2008 Comments: 0There Will Be Porn5:57 AM Wednesday Dec 17, 2008 Comments: 0I'm a fan of Zed Shaw. He has nothing to do with .NET or anything I do on a daily basis but reading or listening to him rant about whatever has given me some good ideas for stuff I do or wanna do. Anway, he's got this farewell to Ruby and Rails thing. INFOQ recorded his goodbye presentation at RubyFringe entitle There Will Be Porn. It's about 49 minutes long. I made it through the first half before skipping around to the end. The last 5 minutes or so discussing what he'll be doing next was the most interesting to me. S#arp Architecture10:10 PM Tuesday Dec 16, 2008 Comments: 3S#arp Architecture has been receiving alot of attention recently. Today, with some colleagues, we went through that architecture, the reference solution and the northwind sample app. I've only spent today reviewing the code but already it smells of CSLA. Anyone who's had had the displeasure of working on a CSLA project will understand why "smelling like CSLA" is not a good thing. For me, the biggest use of the S#arp Architecture is to give me ideas on how to improve the architectures I create. I've already started a new architecture based on some ideas from the S#arp solution. Even CSLA gave me ideas;however, they are ideas on what NOT to do, like use CSLA(did I mention I don't like CSLA?) Anywho, expect more on this since we're digging through and refacturing existing code based on these ideas. -256:37 AM Monday Dec 15, 2008 Comments: 1The temp right now in Fort Collins is -15, and the windchill makes it feel like -25. For anybody wondering, -25 degrees is really fucking cold. I Love To Jerk And I Cannot Lie....6:4 PM Thursday Dec 11, 2008 Comments: 0I ended up with 109kg(240-ish pounds), I was stoked. I Got Schmapped!5:31 PM Saturday Dec 6, 2008 Comments: 0How cool is this. This flickr photo of me running the Boulder Boulder 10k in 2006 found it's way into Schmap for Boulder events. Like My Screen Snaps?2:10 PM Saturday Dec 6, 2008 Comments: 2I use WinSnap from NTWind Software to take screen snapshots. It adds the nice little things like drop shadows. It sits in your systray waiting for you to hit CTRL + PrtSc, and then gives you options of hitting the entire desktop, only one application, or even a region. It's worth checking out, they have some other cool tools too worth takin a look at. What Kind Of A Blog Is This Anyway1:32 PM Saturday Dec 6, 2008 Comments: 2According to http://typealyzer.com/ I am this type of blogger(I really wish it was a cooler picture): 58 WPM9:42 AM Saturday Dec 6, 2008 Comments: 0I took Pete's typing challenge and decided to practice my webcam in a screencast technique, so here's me typing 58 words per minute, and yes, I will break 60wpm with no errors mby the end of the weekend :) Whoops, How'd That Get Past QA?12:53 PM Monday Dec 1, 2008 Comments: 0 |
|