Object Hydrator - Big changes afoot.

Since last I posted, I've received an awesome implementation of a fluent interface for Object Hydrator from Scott Monnig.  We've ditched the Attributes and mapping scenarios in favor of some convention and  a fluent interface.

So as before this will get you a single customer:

Hydrator<SimpleCustomer> hydrator = new Hydrator<SimpleCustomer>();

SimpleCustomer customer = hydrator.GetSingle();

The difference here is that SimpleCustomer looks slimmer like this:

        public string FirstName { get; set; }

        public string LastName { get; set; }

        public string Company { get; set; }

        public string Description { get; set; }

        public int Locations { get; set; }

        public DateTime IncorporatedOn { get; set; }

        public Double Revenue { get; set; }

By convention FirstName, fname etc...will use the FirstNameGenerator...and so on.  If there is no infered generator, it will pick one by type.

 If you want to override a value, you do it like this:

            string defaultValue = "Testing123";

 

            Hydrator<SimpleCustomer> hydrator = new Hydrator<SimpleCustomer>()

                .WithDefault("Description", defaultValue);

Easy huh?

What if you wanted to override the Company name with a FirstNameGenerator value for some wacky reason?  Piece of cake...

            Hydrator<SimpleCustomer> hydrator = new Hydrator<SimpleCustomer>()

            .FromGenerator("Company", new FirstNameGenerator());

            SimpleCustomer customer = hydrator.GetSingle();

Aggregate roots are still being worked on and are in this code they require a little deeper info, but check out the source if you are curious where we're going with those.

Please check out the source at http://objecthydrator.codeplex.com and peruse the tests to see more examples.  I'll be doing a deeper write up as we make that first .1 release and will include the source. 

Thanks a ton to Scott and as always feel free to let me know what you think.

Published Monday, October 05, 2009 12:52 PM by ryansjedi
Filed under: , ,

Comments

# Object Hydrator - Big changes afoot.@ Monday, October 05, 2009 8:34 PM

DotNetBurner - burning hot .net content

# re: Object Hydrator - Big changes afoot.@ Friday, November 02, 2012 8:29 PM

<a href=wagabi.com/index.php Yes it is a fantasy</a>

# re: Object Hydrator - Big changes afoot.@ Sunday, November 04, 2012 11:29 AM

<a href=yuejin-club.ru/.../> I consider, that you have misled.</a>

# re: Object Hydrator - Big changes afoot.@ Thursday, December 13, 2012 9:08 PM

P.S. Please review our <a href="http://weblancerhelp.com">design portfolio</a> for Doors2012.

Five Easily Avoidable Mobile Web Design Mistakes

When was the last time you viewed a webpage on your mobile phone or tablet computer? If you said "today", you wouldn't be alone. Increasing numbers of people are using mobile devices to surf the Internet, but is your website ready? While mobile, or adaptive, web design is big neews; some companies are making the same mistakes with their designs:Ignoring Device WidthLike laptop and desktop monitors, the screen shape and size of mobile devices varies considerably. Depending on the size of the screen being used, many users will be unable to see your content displayed correctly, resulting in them leaving the website. It is important your designs are able to adapt to fit whatever size screen they are being displayed on.Long Load TimesFilling your website with images may look great on a computer screen, but have you considered them loading on a mobile? If your page takes too long to display fully on a mobile device, visitors will simply hit the "back" button, and move on to your competitors. You can maintain your brand identity and the "look" of your original website, without the long load times with a mobile specific site. A graphic design company will be able to design a minimalist design, specific for mobile devices.Endless Form FillingGenerating leads through a contact form on a mobile site is not as easy as it is when using a desktop. Filling in long forms on a small screen can be a very tedious process, and visitors may be unsure of just how safe their details are. Make sure your forms are simple and easy to navigate on both mobile and computer.Functionality FailsDon't forget that a mouse pointer, and a users' finger vary greatly in size. When designing for mobiles, consider placing icons further apart so users don't hit the wrong button by mistake. Icons should also be large enough to be clicked without the need for zooming in - or out.Not Going Mobile At AllBy implementing a mobile web design you can eradicate most of these issues. If your website hasn't been optimised for use no smart phones and tablets, or you don't have a separate mobile site, your business could be losing out.Internet browsers are increasingly impatient and want all the information they are searching for in an instant. Tha'ts why mobile browsing has become so popular. Make sure your company is ready, with mobile web design.

Leave a Comment

(required) 
(required) 
(optional)
(required)