COWFARM.NET - THE NUMBER 1 SOURCE FOR GRAZING DEVELOPERS AND MILKING DESIGNERS!


Nov 30: Starting NHibernate | Adding DLLs

Over the next couple of weeks I will be diving down into Nhibernate. It is only fitting that today I spend a little time showing you how to add the DLL files that you need to start your project and the basic configuration for it. At times throughout these articles I may pause to discuss some of the open source technologies surrounding NHibernate and how they may better your solution and development process. So, let’s dive in click “continue reading” below to start.

Continue Reading | Ask Questions

Nov 24: Jumpstart your ASP.NET MVC Project

It has been a long time in my learning process of ASP.NET MVC and from it: I have discovered so many interesting things. I think at this time I am ready to share my findings.

I’m going to start by talking about the frameworks I found useful without boring you with what an MVC framework is composed of. So let us start:

ASP.NET MVC 2.0http://www.asp.net/mvc/download/

Of course, the first would be the actual base framework. Currently in Beta, it is expected to hit RC1 half way between its final release with Visual Studio 2010 in March 2010. I strongly encourage you to utilize the Beta version and upgrade to the RC1 when it is released.

Spark View Enginehttp://sparkviewengine.com/

The spark view engine, is what most would call a “true” MVC view render engine. I personally like this engine because it has the ability to be a “general purpose template engine” as well as a view engine. The down side with the ASP.NET MVC view engine is that: outside of your HttpContext/ControllerContext it renders itself to be completely useless for Rendering Views.
With Spark, you can build up templates anywhere you reference your Spark.dll. What’s the point of this? Let’s say you want to build up an Email Template, which uses dynamic data. Spark is your best bet for that. I’ll go into this in a later tutorial.

AutoMapperhttp://automapper.codeplex.com/

The AutoMapper framework is catching eyes in the MVC community and might someday have a great influence on the actual ASP.NET MVC Framework. To put it in the simplest terms: automapper takes your domain objects and translates them into your view model objects, with minimal coding from you. If you ever find yourself writing large amounts of redundant translation code for your data objects, chances are you need this framework.

Dot Less CSShttp://www.dotlesscss.com/

The Dot less framework is actually is a .NET implementation of the LESS framework for Ruby. The LESS framework is a wrapper for CSS that allows you to write clean CSS by using “variables, mixins, and nested rules”. It is very easy to setup, and can clean up your CSS files by a lot. You could think of it as a head start on CSS3 and avoid CSS HELL.

JQueryhttp://jquery.com/

Is a JavaScript framework for those of us who hate writing JavaScript. This framework makes it easy to select dom objects, writing events, apply styles, run effects, and most importantly write AJAX calls to your ASP.NET MVC Application.

NHibernatehttp://nhforge.org/

One beast to rule them all. NHibernate is an ORM framework that allows you to bind your domain layer objects to your relational database. If you hear people talking about a data access layer this is where this framework will exist. I recommend anyone to read as much as they can on this framework. It plays a big part in the MVC world and making sure that your data access is smooth and simple in the long run.

Linq to NHibernatehttp://sourceforge.net/projects/nhibernate/files/

If you have not heard of Linq then you probably have a lot of catching up to do. Thanks to Oren Eini we now have full Linq support for Nhibernate, no need for that pesky Hibernate Query Language. As a note, it can usually be found in the NHibernate repository and will usually be one build behind in its own DLL File.

StructureMaphttp://structuremap.sourceforge.net

Inversion of Control, Dependency Injection, yeah I had my head spinning if not still from all the ongoing conversations about all these fancy words ;) . Surprisingly enough, I realized when I was done reading about it; I had used something similar to this back in my Java/Spring days.
What is it, what does it do? It is a design pattern nothing more which through interfaces allows you to remove dependencies on concrete classes, and “inject” locate, put, setup (whatever) those interfaces based on a set of rules. This type of pattern will be very useful in developing your growing web application. Structure map is just a framework that I have come to like after exploring other IoC containers such as Windsor.

Moqhttp://code.google.com/p/moq/

This is a mocking framework pronounced mock-you that allows you to mock up interfaces and classes in your testing framework, to avoid things such as connecting to your database or services. I have a few tutorials already posted up on the website on how to utilize this technology, feel free to explore them and utilize them.

Sharp Test Exhttp://sharptestex.codeplex.com/

This is a fun little framework that lets you write fluent assertions for your unit tests and at the same time really helps you write the tests you really should be writing. Check it out you will see what I mean.

WebAiihttp://www.artoftest.com/products/webaii.aspx
I have been using this front end unit testing framework for quite a while now, and it hasn’t failed me yet. Though I can’t say I am a big fan of the other tool which “attempts” to generate the testing code for you. This little framework is awesome, and really easy to use if you are more a developer then a tester.

And that is for now. I look forward to starting off this series of tutorials with How to build an Email Template Manager with Spark.

Continue Reading | 1 Question/Answer »

Oct 15: Handle user back button

I just wanted to put this here. Whenever, a user clicks the back button on a browser or the backspace key, your website, especially one using JavaScript, jQuery, Mootools, whichever… Won’t handle any changes or clear itself.

It is always good practice to make sure that these user actions are handled correctly. This can be accomplished by simply adding a basic JavaScript onload…

For example:

    <script type="text/javascript">
        onload = function() {
            $("input").attr("checked", "");
        };
    </script>

In this case, I am using jQuery to clear out radio/check boxes on a page, anytime it loads.

Continue Reading | Ask Questions

Apr 21: Moq Testing Tutorial

In this tutorial I will take you through a mocking framework called Moq for (.NET 3.5) released under the New BSD License. Although, I will not be discussing what Mocking is for that is outside the scope of this tutorial. You can find out more on this by going to: What is mocking/mock object? This tutorial has in depth information how to peruse using this framework along with many sample code snippets.

Continue Reading | 2 Questions/Answers »

Apr 20: Going Social

Another update! Every post will now have the ability for you to share our links. We know at this point there isn’t much to share but we are working on it. Also a little more customization is coming soon to the website.

Continue Reading | Ask Questions

Apr 18: Updates To CowFarm

I just wanted to let you know that I am currently pushing many updates to the website. So there are going to be a lot of problems here and there. Please, bare with me as I get the site functional. I have also been hit by a lot of bots recently so I decided that I will have to approve your comment whenever you post.

Also many links are not functional yet. I will hover be slowly rolling out a set of new features such as code dump which will contain lots of uncompleted/completed code projects released under the Creative Commons Licenses.

Continue Reading | Ask Questions

Mar 19: Internet Explorer 8, Not Really!

You might as well update to Internet Explorer 8 today, it’s not much of an improvement over any other IE browsers you have used. It still asks you to restart your machine, it still takes 40 minutes to install, and it still tries to update your computer at least four times during your install.

We know that Microsoft is a large corporation with a lot of power to do good. What we don’t get is why the fail to utilize this power to “Start Over!” imagine if Microsoft released a whole new browser, different branding different technologies, that would surely spark our interest!

Continue Reading | Ask Questions

Mar 18: Blend 3, SuperPreview (Web 3), Silverlight 3

After the first day of Microsoft’s MIX 09 we are left to explore all of the new tools and updates that have been released. After running the released demo’s, I am left with some thoughts. Oh, of course I shall point you to the downloads so you can have the full experience too.

There is nothing better then getting a good hands on. Although there aren’t many of these features available right this moment, what is out is worth jumping on top of while you have the chance. So go ahead and explore by clicking continue reading below.

Continue Reading | 1 Question/Answer »

Mar 13: IEmailTemplateService, Headers/Postback WorkAround

I spent the day with ASP.NET MVC EmailTemplates, and IEmailTemplateService recieving an error from IIS that HTTP Headers have already been sent (Response.Headers) or just a sent email without any call back to our browser. I dived down into the MvcContrib source code (IEmailTemplateService.RenderMessage), started seeing code dealing with Response.Filters and MemoryStreams, OutputStreams(TextWriter), and firing View.Render.

Continue Reading | 1 Question/Answer »












Andrew Kharlamov

Hello, my name is Andrew Kharlamov (Harlamof), or Andrei if you want to get really technical. Currently, I live, ski, and work in Salt Lake City, with my lovely wife Katya.

In this blog I will take you through some of the new technologies in our industry and their quirks. I will attempt to break them down, where a developer of any level can understand and utilize them. Hopefully, I will do all of that before either you or I bang our heads on the desk and decide to live on a farm in Kansas with a little dog named Toto.

Photoshop Articles.NET ArticlesWeb ArticlesScript ArticlesSQL Articles