Welcome

You have reached the blog of Keith Elder. Thank you for visiting! Feel free to click the twitter icon to the right and follow me on twitter.

Summit Feedback is Good

Posted by Keith Elder | Posted in .Net, Asp.Net | Posted on 21-09-2006

0

 It is interesting to see what others are saying about the summit and the best way to find out is just read people’s blog.  John C Bland is the CEO and founder of Katapult Media.  He is sitting in front of me at the summit and he’s been blogging all day.  We spoke during lunch today and he has a lot of experience in PHP and Cold Fusion so it is interesting to see what his take aways are from the perspective.   Check out these two posts from John on his blog.

  1. Microsoft folks are cool
  2. ScottGu, LINQ, ASP.NET, IIS 7, and Atlas rock – see this post if you want to get more details on what Scott showed during his session and what John thinks about what Scott showed. 

 

Alabama Code Camp

Posted by Keith Elder | Posted in .Net, Presentations, Smart Clients | Posted on 13-09-2006

0

Saturday October 28th is the Alabama Code Camp in Montgomery, AL.  Some great speakers are getting lined up and although I had to pay Joe Healy a large amount of money to speak at the event, he finally let me in 🙂 I will be doing two sessions on Smart Clients.  One is an intro to Smart Clients and new features of Visual Studio.  The second one I’m doing is all about the Enterprise Architecture of Smart Clients.   Others are covering Atlas, Mobile 5 applications, ADO.Net 2.0 and lots more.  Should be a great code camp!

Codesmith and .NetTiers thoughts

Posted by Keith Elder | Posted in .Net, Programming, Smart Clients | Posted on 27-07-2006

2

I was catching up on some blog reading tonight and saw where Daniel had posted about using Codesmith and .NetTiers to generate code.  I’ve been using this for several months myself but hadn’t gotten around to blogging about it.

Quick intro to what it is.  Codesmith is a client app that users templates to generate code.  .NetTiers is an open source projected that provides templates to generate a n-tiered architecture.  If you watched my video cast of building a three tiered architecture in Visual Studio, using these two tools can quickly create the business and datalayer for a project.  Obviously it isn’t going to write business objects for you with all of your validation rules, but it does provide a start (if you think business objects are database records, which I don’t fully agree with).  On the Codesmith site you’ll find a nice 15 minute tutorial which can explain better how they work together.

The thing I use the most with .NetTiers is validating business entities.  Let’s say you have a Contact table in a database.  After .NetTiers runs, it will create a business object called “Contact”.  This object is generated into two partial class files typically called:

  • Contact.cs
  • Contact.generated.cs

The generated file shouldn’t be modified, the other you can modify.  Typically you will add a new method called “AddValidation()” to the Contact.cs object called from the constructor which adds all of your business rules.  For example, FirstName and LastName are required fields.  First and Last name much pass a regular expression validation before saving.  There is a folder in the businesslayer that .NetTiers generates called Validation where there are several generic objects to assist you with common validation rules. You can also add your own.  For example, you could write a method to have the database check to make sure no one else has the first and last name in the database before saving it.  The validation rules use delegates so you can write any method or logic you need to do validation.  Here’s some sample validation code:

    1 Validation.CommonRules.CompareValueRuleArgs<int> schemaValidationArgs =   new Validation.CommonRules.CompareValueRuleArgs<int>(“SchemaValidationId”, 0);

    2             schemaValidationArgs.Description = “Schema Validation is a required field and must be greater than 0.”;

In the example above the property SchemaValidatoinId must be great than 0.   The way the validation in .NetTiers is setup is based on a collection of validation rules.  Once your list of rules is established you simply need to invoke the Validate() on the object.  Validate then processes all of the rules in the list, making calls out to each delegate as it needs to.  What gets created as a result of this is a BrokenRulesList which is a property of your business entity.  Since I don’t have a contact table handy to generate actual code, here is some sudo code as to how things fit together.

    1 using System;

    2 

    3 /// <summary>

    4 /// Summary description for Contact

    5 /// </summary>

    6 public class Contact : ContactBase

    7 {

    8     public Contact():base()

    9     {

   10         AddValidation();

   11     }

   12 

   13     private void AddValidation()

   14     {

   15         Validation.ValidationRuleArgs nameArgs = new ValidationRuleArgs(“FirstName”);

   16         nameArgs.Description = “First Name is a required field.”;

   17         this.ValidationRules.AddRule(Validation.CommonRules.StringRequired, nameArgs);

   18     }

   19 }

   20 

   21 public class Test

   22 {

   23     Test()

   24     {

   25         Contact contact =  new Contact();

   26         contact.Validate();

   27         if (contact.BrokenRulesList.Length > 0)

   28         {

   29             // whoops, you have errors

   30         }

   31     }

   32 }

 

If you are like me and are writing Smart Clients with web services, the BrokenRulesList gives you an easy way to let user’s know what is wrong.  As a typical pattern, I pass the BrokenRulesList (which contains brokenRule objects) as an out parameter on the web service.  This way I can easily display or handle the errors in the Smart Client so it is friendly to the user.

 

Since you know the property in the BrokenRule object that is causing the problem, along with the description of the error, a quick foreach loop through your input controls on your windows form and you can automatically set ErrorProviders on your controls (same could apply for asp.net).  This could all be automated as well with enough time I think too. 

 

One thing I’ve noticed about some developers using .NetTiers is once they start using it, they want to use it for everything!  This is just wrong.  If you think of it from the standpoint of being able to put business rules and validation on information before it hits the database, you’ll be ok.  It isn’t the swiss army knife of developing apps though. 

 

Here is something else to consider about .NetTiers.  What if you only need to display one record with limited data, one or two columns?  This is where .NetTiers doesn’t help at all because given a primary key or a search filter it will always load the entire record.  To my knowledge there is no way to tell it what to load or not to load into the object.  Which logically speaking makes sense because if you updated the information you wouldn’t be able to pass the business rules of the object to save it.  It’s a catch 22 really.  In this case it is easier to just write your own query.  Sometimes you may not care, but in the enterprise where speed counts, you just can’t afford to be lazy.

Internal .Net User Groups – An untapped resource to get information into the trenches

Posted by Keith Elder | Posted in .Net | Posted on 25-07-2006

0

Have you ever heard of something called “user groups”?  In regards to technology user groups have been around for awhile.  As a matter of fact a lot of the technology we use today was showcased, debated and ultimately formed into companies because of user groups.  User groups have been meeting for decades and they serve as a way for the so called “elite” of technology to showcase their wares.  Since this is a .Net related web site I wanted to talk about .Net user groups.  Due to this site’s targeted reader, more than likely whoever is reading this has heard of or attended a .Net User Group.  But, did you know there were two different types of .Net user groups?

External vs Internal
The two types of groups I am referring to I am going to label them as “internal” and “external”.  External groups are the typical groups we think of when someone mentions a user group.   External groups are organized by various .Net developers/evangelist and held in public places such as colleges, companies, etc.  They meet once a month and are open to anyone that wants to attend.  The typical format is someone presents a topic, there is Q & A and then afterwards some of the members go to the bar to hob knob and talk shop.  So what are “Internal User Groups”?  The main difference is an internal user group is held inside a given company.  In other words you have to be employed at said company to attend.  Internal .Net User Groups are an untapped resource within the community today.  If held within the right company they have more potential of attendance and information spreading than an external .Net User Group.  Internal groups also provide an avenue to get information to those that can’t otherwise attend external groups regularly.  If you haven’t thought about starting an internal group or if you just want further information about them I hope this article helps.  Before we move forward please let me clarify that while this article is speaking primarily about .Net User Groups, the same situations can be applied to other user groups. 

The Problems with External User Groups
The bottom line is it would be great if everyone employed in IT would attend a user group meeting but they don’t.  Why is that?  Don’t we all want to learn something new that would help our career or help our employer?  In some cases yes, but in most cases there are just other priorities.  In order to understand why this happens we have to look at some of the problems trying to get people to attend user group meetings.  Then we need to look at how to overcome these problems by offering an alternative.  To get started let’s look at the problems of external user groups.   If you look at the amount of effort required to attend a user group meeting for people that have families, the effort doesn’t match up to the gain.  It is no wonder these people never go.  Here are some problems I’ve identified that hinder people from attending:

·        Prior family obligations

·        Baby sitting

·        Travel time

·        Motivation

·        Social intimidation

·        Conflicts with other interests

Prior family obligations
Prior family obligations is number one on the list and with good reason.  Reasons range from:

·        the kids have to play soccer tonight

·        we have to go to the play my child is in

·        we are going to my mother’s for supper

·        a child is sick

·        I have to mow the yard

·        we are remodeling our home

·        <insert life here>

This list can grow to the size of a mountain in a short time if you add up why people don’t attend user group meetings regularly.  If someone doesn’t want to go they can always pull one of these out of the hat as an excuse as well.  In the person’s defense though, we spend most of our time working and very little time at home as it is.  For a lot of families it is tough to break out of the cycle of the daily routine.  It is also hard for two working parents to find time to break away and go to a meeting.  For those of you that run or attend external user groups look at how many people don’t attend because of this very reason.  Then ask yourself is there anything you as a group can do that will fix this problem.  The answer you will ultimately come to is no.  It is just the way it is. Granted there maybe a certain topic that would drive a person to attend a meeting but always remember the person’s family is going to come first over a user group meeting (as it should).

Baby sitting
If a person is able to arrange their family priorities so they can attend an external user group meeting and they have children, baby sitting may still stop them from attending, especially for single parent families.  Not only can it be hard to arrange baby sitting but it can also be costly.  Put yourself in their shoes and ask yourself this question, “Will spending $25 on a baby sitter for a few hours be worth it to attend a user group meeting”?  In other words will attending the meeting be that life altering?  Maybe if Bill himself shows up at the meeting but in all likelihood probably not.  

Travel Time
Even though arrangements with a baby sitter could be made another major hurdle has to be overcome and that is the act of physically getting there. 

The baby sitter is all set and just arrived, the kids have been fed and watered and you are ready to go to the meeting.  Now all you have to do is drive 30-40 minutes to get there. 

For some people this may not be a big deal.  For others it will be.   For example travel time is a big deal if you are living in Michigan and attending a meeting in January.  It is snowing outside, cold, and you already spent two hours in traffic this morning getting back and forth to work.  Unless you are fortunate enough to live around the corner this may play a major factor if you’re attending the meeting.  It is also worthy mentioning that some people drive 30 – 40 minutes to work.  If the external group meets another 30 minutes away from that person’s work, they would have to leave work directly to attend the meeting in a lot of cases.  This may put a person who wants to attend even further from home depending on the location of the meeting.  If they have family priorities (picking up children from day care) this person isn’t coming at all. 

Motivation
The first three reasons above are pretty concrete but let’s look at some more abstract reasons people may not attend external user groups.  Let’s do a “deep dive” if you will into the psyche of attendees and non-attendees. You have to remember that if someone chooses to attend a user group meeting they have to be motivated to do so.  Some people are just motivated when it comes to learning.  Others are not.  Here’s an example.  There are thousands upon thousands of business majors in the world today.  Out of those thousands, how many have subscriptions to the Wall Street Journal?  How many live and breath stocks and financials?  How many of them read material that wasn’t assigned in class?  How many of them are “geeks” of business?  The answer is about 1-2% according to studies I did in college.  Some people just aren’t motivated to learn anything outside of what they have to.  They learn just enough to get a job and do that job (and some are very successful at this).  According to my numbers 98%-99% of people aren’t motivated to learn on their own time about technology.  Based on that then, who attends these meetings?  The answer is the 2% rule, mostly “geeks” of course.  I am not talking about people wearing pen protectors here either.  I’m simply talking about bright motivated individuals that are trying to get as much information as they can.  The bottom line is the majority of people that should attend external user group meetings either have other priorities with family or they don’t have the motivation to attend.  Typically these types of people are happy knowing what they don’t know.  More than likely technology is not what they eat, sleep and breathe.  If you then correlate the number of user groups started by geeks and non-geeks (using these terms based on the above pretense) you start to realize the whole meeting is a Geekfest (copyright Keith Elder 2006).  But what about those that aren’t geeks?  How can we get information to them?  Aren’t these people in the trenches doing work everyday? Can’t we make it easier for them rather than institute something that excludes them?

Social Intimidation
I think this topic is self explanatory and only accounts for a few people not attending external user groups.   It is a factor nonetheless.  For whatever reason some people do not want to attend by themselves or they don’t want to attend because they don’t know anyone else at the meeting.  This is an easy problem to solve for external user groups if the group is friendly and approachable.

Conflicts with other interests
More times than not I’ve heard this one while attending groups.  I’ll ask the person why they didn’t attend the last several meetings and the answer will be something related to another group or interests going on the same night.  Of course you can also add anything in the first bullet point to this one as well I guess, but I am primarily talking about people who attend other meetings and have other interests.

Start an Internal Group
I’m not saying that External .Net User Groups are evil or anything like that, I’m simply pointing out problems as to why more people don’t attend them.  Some of the problems I mentioned cannot be fixed by the organizer of the user groups either.  It is just how things are.  However, there is an alternative that doesn’t have these problems and provides a much easier avenue of entrance for the average person.  If you work for a larger company you may want to consider organizing an Internal .Net User Group.   Let’s look at some benefits or advantages Internal User Groups have over External ones.

1.      Family priorities are already handled unless something comes up during the middle of the day.  In other words, the person is already at work and has made the arrangements.  No additional effort is required on their part.  You can mark off baby sitting as being handled as well.

2.      The person is already at work so there is no travel time other than going into the office.  The person is already there and simply has to walk down the hall to attend.

3.      You get access to the other 98%.  For those that aren’t “geeks” as described above, having the group internally means it is easily accessible and this makes it easy for everyone to get involved and learn.  As an example, the Internal .Net User Group I started is made up of internal team members from different areas within IS.  Anyone from Support Engineers, System Engineers, Software Engineers, Architects, Business Analyst, Workflow Engineers, Team Leaders and even the CIO are invited to attend the meetings.  Does this mean they all come to every meeting?  No.  They come to meetings which are related to their jobs.  If we have a presentation on Biztalk we’ll get software engineers, system engineers and work flow engineers. If we are having a talk on Enterprise Library we’ll probably just get software engineers.  Regardless of who shows up, the group provides a value service to those who would never otherwise be exposed to the same content.

4.      In house training at a low cost.  If you wanted to get team members together to educate them on new technologies, how do you do it today?  Having a planned time with planned topics that can be focused toward your business is a great way to spread information into the trenches where team members are using it.

5.      If there are local external user groups in the area, your internal group can still benefit when guest speakers come to town.  Since internal groups meet during the day during business hours, and the other groups typically meet at night, it is easy to “share a presenter”.   As an example, we recently had Joe Stagner come in from the Asp.Net product team who spoke to us on Atlas.  Not only did we get cutting edge information out to a lot of our team members, Joe did the same presentation at five other user groups in the area over the course of three days.  Very cool.

6.      Leverage the time to showcase in house teams / solutions.  This is a big benefit because if you have teams that have built a product or solution, take the time to show others.   More than likely others will or have run into the same situations.

Final Thoughts
Hopefully you see having an Internal .Net User Group has a lot of potential if done in the right size of company.  It allows for those who would never attend a presentation to get information and allows you to expand the community by getting information into the trenches to those that would otherwise never get it.  One last thing I should note is the difference of how one is run over the other.  Keep in mind that internal groups should be focused on knowledge transfer.  It isn’t as much about the social aspect of things as it is for external groups.  If you are meeting during business hours keep things short and sweet, otherwise you take too much time away from work.  The following is a formula I try to stick with.  Since the format is no different than a regular internal office meeting, everyone is comfortable with the routine.  Most of the time you know everyone that works at your company so there isn’t any need for introductions unless you have a new team member.  Keep things simple.

1.      the group meets

2.      give them lots of cool whiz bang information they can use

3.      send them back to work

Remember that people are at work so meetings should be short, on time, and concise.

Conclusion
If you work for a large company and you want to get technical information out to your team members in the trenches, think about starting an Internal .Net User Group.  

Interesting .Net / Java questions answered by MSFT Architect

Posted by Keith Elder | Posted in .Net, Java / Javascript | Posted on 20-07-2006

0

Dave Schmidt was sent some pretty tough questions from a customer that were obviously slated toward using Java over .Net.  David responded to the questions and decided to post them to his blog since he spent so much time responding.  Although he is a Microsoft employee (take that with what you will) he does have some great points on some of the questions.  Others I think I could have answered better.  I almost missed the document he attached about .Net Momentum Evidence which was at the bottom of the post.  The most interesting section in this document to me was the “Customer Endorsement of .Net over Java-based Alternatives”.