eriklane posted on October 25, 2006 01:57

This is a bookmark for me plus just an opportunity to get the word out there on PrinciplePermissionAttributes.  I've not see this before and it looks like something I will use in the future.

Here's post from Scott on the topic with and the original article from Scott Guthrie.  Both have good examples and ScottGu's post has a good discussion going on in the comments.

 

Giddy Up!


Posted in: Development & Geek Stuff  Tags:
eriklane posted on October 24, 2006 16:36
Twistpad is on the scene!

I've been a loyal Textpad user for a many number of years and influenced a company or two to buy site licenses for it. I occasionally peek over at the Textpad forums to see if there is any movement or developments. There are none to be seen. At first I was wondering what was going on? Nothing new or bug fixes since 2004. I don't say anything or venture out to try out any other options (Notepad2, UltraEdit, or Notepad++).

When Ryan Farley posted his quick review of Twistpad I actually downloaded it and installed it. I goofed around with it for about ten minutes and then uninstalled it. I just wasn't that impressed. Was it flashy or have some cool features? Yep, it sure does. But for what Textpad is, a replacement for Windows Notepad, nothing is better. Twistpad is pretending to be an IDE and I've got that covered.

This little test run just made me realize how great Textpad really is. It's fast, efficient, and has tons of functionality FOR A TEXT EDITOR..and that's ok. No shame it that. I do use the syntax highlighting but that just helps me differentiate the syntax. I don't need or want intellisense or collapsing regions in a text editor. Textpad gives me what I want.

I went back over to the Textpad forums and found a thread discussing the "lack" of new features being released.
  • Fascinating, I didn't realize it was so antiquated. So does TP not meet your needs or is it simply that a new version has not been released since 4.7.3 and thus it's old?
  • TextPad is great, but it's not designed to be an IDE...TextPad can't be beat for almost everything else, it's so fast, lightweight, I can have 20 files open in selector; search is fantastic; very flexible document classes; etc.
  • One the one hand I miss some of the features I have seen in other applications but on the other hand I enjoy using a somehow limited but finely crafted, stable, speedy and homogeneous application. Over the years some of the competitive products have kept on to wildly integrate so many user wishes that they have became bloated and shapeless.
I agree with these guys 100%. Twistpad may be on the scene but Textpad is in my toolbox!

Posted in: Development & Geek Stuff  Tags:
eriklane posted on October 24, 2006 15:50
Jeff Atwood brings up the terminology used to describe different aspects of the Scrum Process. At Tulsa Techfest Tim Gifford went through this and even showed the cartoon below from ImplementingScrum.com.



Everything in Scrum has a funny name for it...even the process. Funny names or not, at least its been thought out enough to be named.  The funny names used in Scrum gets to the point of everyone knows what's going on. If it is defined and everyone plays by the rules then being a chicken or pig makes sense and everyone can rely on it. Everyone follows the rules and work gets done. As I mentioned in my summary for Tim's session - I just like the process of getting quick feedback on your work (led me to use TDD), everyone knowing what's going on, and team members knowing what's expected of them.

From ControlChaos.com
  • Scrum is a way to improve communications and maximize co-operation.
  • Scrum is a way for everyone to feel good about their job, their contributions, and that they have done the very best they possibly could.
I really like that second point. Wow! Feeling good about their job? What a concept. Still, the tricky part is that we (fallible humans) are part of the process. So we must all do our part for the greater good.

Posted in: Development & Geek Stuff  Tags:
eriklane posted on October 19, 2006 16:31

As I posted a day or so ago, I've moved my RSS feed over to FeedBurner.  I did a make a small change will let you subscribe to a particular category instead of making everyone subscribe to the main feed.  Again, your aggregator should automatically pick up the change so there will be nothing new on your part.

Giddy Up!


eriklane posted on October 17, 2006 20:05

I'm in the process of switching my RSS feed over to FeedBurner.  In doing so there will only be one feed for my blog.  I think most, if not all, just subscribe to the main feed so this may not be a big deal.  If you do subscribe to a specific category please let me know and I'll be more than happy to work out a way to keep the category feeds alive.

Also, when I do make the switch you shouldn't have to make any adjustments to your subscription.  Your aggregator should pick up the change immediately.


eriklane posted on October 15, 2006 17:17

I've read about other code camps and since I'm in KC at the moment I wasn't able to attend the Dallas Code Camp back in June. Thankfully, at the end of August I learned of Tulsa Techfest. Tulsa is only a 4 1/2 hour drive and my wife has family there that I was able to stay with and visit with on Friday night. The drive down was uneventful and I was able to catch up on my backlog of podcasts which was a nice added benefit.

These are the things I took away from the sessions

Use Strongly-Typed Session Wrapper, Raymond Lewallen - This is a great idea and a great way to keep the session object from getting bloated with duplicate data and the performance hit of boxing/unboxing if you store value types in the session. One key point that I took away from the presentation was that by having all of the developers on a team use this custom session object forces everyone to agree with putting something in the session since it requires a change to the class. Plus, it also keeps everyone in the loop on what is available in the session. How many times have you been on project where multiple copies of the same data were stored in the session? This is a blog post he has on the same topic that gives some of the sample code.

Continuous Integration, Raymond Lewallen - The team on my current contract is using CI and it is awesome! We don't do all of the bells and whistles (working on it though) but just having the code build with each check-in is great. I can't think of working on a project without it now that I've been using it. This session has some awesome take-away code. Raymond walked us through the sample code and by the end of the session we had everything setup and working. Everything meaning - CruiseControl.Net, NAnt, Subversion, Tortis, TestDriven.Net, NCover, and FXCop. He would check-in the example project to subversion and that would kick off the whole process. Good stuff! I know others that have spent a few days to setup what he had setup on 45 minutes. Fyi, it's located here and the readme file that is included in the zip file is exactly what he used during the session.

Anti-Patterns in Software Projects - The Human Factor, Robert DaigneauAnti-Patterns are typically discussed around software design or programming. This session wasn't about code. It was from the stand point of working within a team environment and how to be successful at it. Topics like this intrigue me since you can have the most talented developers on a team and still not produce a quality product or even enjoy going to work everyday. Rob defines it like this - "Problems caused by people that impede the success of a software project."

He covered many types of developers that can mean trouble to a project: The Defensive Developer, The Fortress, The Perfectionist, and The Workaholic. We all have worked with people who fit into these categories. The trick is how to deal with them and also realize that we may be like this and what we are doing to change. One point that he made that I'm going to share here (hope he doesn't mind).

The "Ugly Baby Syndrome"

  • We love our work like parents love their kids.
  • Be careful with criticism
  • Uninvited advice
  • Misunderstanding the context
  • Nit-pickiness
  • Code-Review abuse

I'm putting it here because I feel that it is a very important point when it comes to building a cohesive team that can grow and learn together. Rob covers anti-patterns for leaders too and how to handle burnout and how to make a software development a lifelong career. His entire presentation can be downloaded from his site.

Agile Project Experiences, Tim Gifford - Other than listening to Scott Hanselman discuss Scrum on his podcast I've never really seen or heard about an actual Agile project. Tim discussed Scrum and ran the session like it was a a project. He listed out the three iterations he was going to go through before he started and them tracked to them as he went through the session. That was pretty cool and very creative on his part.

I had to write down the comment he made when he answered the question, “What is Agile?“. He said "What do you do the last two weeks of a project? Do that throughout the entire project!" Well, on my latest project, we all co-located ourselves, had 15 min. stand up meetings every morning (no off topic stuff allowed) and had builds sent to QA everyday at 3pm. It was great and I could get use to working like that everyday. Everyone was in the loop and everyone knew what was expected of them. It was great.

All this did for me was reafirm my desire to be on more projects like what Tim had described. Whether it is Scrum, XP, etc.. I'm not sure I care. I just like the process of getting quick feedback on your work, everyone knowing what's going on, and team members knowing what's expected of them.

The prize give away setup was pretty cool. I had 60+ tickets that I could distribute as I wanted in the different give aways. I put about 40 in the DevExpress one because I wanted a license for DXperience Enterprise which includes a license for CodeRush. Don't get me wrong, I love and use ReSharper everyday but CodeRush has some cool features that I would love to have for free. Most of my other tickets I put in for ComponentOne Enterprise and Telerik Developer license and a bunch of books. I did win the book, Professional .NET Framework 2.0, and got a few free t-shirts and a hat.

This event was free but let me tell you that it sure didn't seem like it. The content, speakers, and setup was as professional as any conference/training I've been to. The OSU-Tulsa classrooms, the main auditorium, free wi-fi, and lunch wa all great and all of the volunteers and sponsors were wonderful. All-in-all it was a great event and I plan on attending more like this in the future.

Giddy Up!


Posted in: Development & Geek Stuff  Tags:
eriklane posted on October 11, 2006 02:46
These are the words of my youngest daughter, Jewel, who is pictured here enjoying some ice cream. She is two years old but today I've been blogging for two years.

I started blogging kind of by accident. I had my own domain and just wanted to play around with the .Text blogging engine so I put it up as a site. Then I found it nice to have a place to write things down. It all began after we visited a new church and I just wanted to write my thoughts down.

As I began reading other blogs (and learning from them) I saw that I could also use it to work on my communication skills through writing and help me in my coding skills. I know I learn and understand things better when I have to explain it.

Anywho, I'm two and hopefully I've not bored the people (all three of you) who read this blog.

Giddy Up!

I blogged about cutting my teeth on Mock-Objects.  They would've solved the need to make my code testable in isolation.  However, two requirements came into the picture:

1.  We needed a way to simulate the third-party web service that would be used for load testing.  Using a Mock-Object solutions doesn't provide this.
2.  Other groups need to be able to use my code but have the ability to configure the third-party web service at runtime.  This is real time code so Mock-Objects don't work for this either.

I'll Inject Your Dependency

My code is partially there as the configuration settings are stored in a configuration database.  So, for load testing and unit testing I could put the new configuration settings in the database and use the code I'm writing to simulate the third-party web service.  This doesn't solve my problem for other groups who have their own settings.  I am not going to maintain their settings and this is something that they will be telling me at runtime.

The functionality of my code and how it uses the web service will not change; who is using it and the configuration could change at runtime.  I'm trying really hard not to see this as just another nail but it looks like the right kind of nail to need the Dependency Injection hammer and I'm going to do it using the Strategy Pattern.  I am going to walk through the process to make my code meet the two aforementioned requirements.

Background on the structure of my code:  I have a factory that returns a class that implements the interface that has all of the properties and methods needed to interact with the third-party web service.  This class is what other parts of the application use because my code abstracts away a lot of details that they don't need to worry about.

Background on the changes I need to make:  There is already a lot of code that is using this code and we shouldn't have to modify it.  Yet, my code needs to accept a custom set of configuration settings to use during the calls to the web service.  I'm planning on having a "default" set of configuration settings that will be instantiated and used when no custom configuration is provided and also be able to plug-in any custom settings, at run-time.

I will have two tests just for this piece:
1.  Make sure I can still use my current code using a new "default" configuration.

2.  Use a custom configuration and see that the right value will be used.

Test #1

 public void UseDefaultConfigurationSettings()
 {
  ServiceApp app = ServiceFactory.CreateService();
  Assert.AreEqual(app.Configuration.ServiceUrl, "
http://localhost/DefaultService.asmx");
 }

Test #2

 public void InjectConfigurationSettings()
 {
  IServiceConfiguration configuration = new CustomConfiguration();
  configuration.ServiceUrl = "
http://localhost/CustomService.asmx";
  ServiceApp app = ServiceFactory.CreateService(configuration);
  Assert.AreEqual(app.Configuration.ServiceUrl, "
http://localhost/CustomService.asmx");
 }

Obviously, none of this will compile since I've not created the IServiceConfiguration interface or other objects/methods that relate to it.

First step is to create the interface:


 public interface IServiceConfiguration
 {
  string ServiceUrl { get; set; }
 }


Second step is to create my DefaultSettings class that will implement IServiceConfiguration and will read the database for the default settings.

 public class DefaultConfiguration : IRiskServiceConfiguration
 {
  private static string _serviceUrl = string.Empty;
  
  public DefaultConfiguration()
  {
   if(_serviceUrl == string.Empty)
   {
    _serviceUrl = GetUrlFromDatabase();
   }
  }
  
  public string ServiceUrl
  {
   get { return _serviceUrl; }
   set { _serviceUrl = value;}
  }
 }


Third step is to create a custom configuration class that will implement the Interface:

 public class CustomConfiguration : IServiceConfiguration
 {
  private string _serviceUrl
  
  public string ServiceUrl
  {
   get { return _serviceUrl; }
   set { _serviceUrl = value; }
  }
 }

Fourth and fifth steps are to modify my class(s) that implement IServiceApp to take an IServiceConfiguration in the constructor and to expose the IServiceConfiguration as a property.

 internal class ServiceApp : IServiceApp
 {
  private IServiceConfiguration _serviceConfiguration;
  
  public ServiceApp()
  {
   _serviceConfiguration = new DefaultConfiguration();
  }
  
  public ServiceApp(IServiceConfiguration customConfig)
  {
   _serviceConfiguration = customConfig;
  }
  
  public IServiceConfiguration Configuration
  {
   get { return _serviceConfiguration; }
  }
  
  ....
 }

This allows the custom settings to be injected into the app that will be making the calls to the physical web service.  I will keep the default constructor that doesn't take any arguments and instantiate the "default" configuration that will be read from the database.  This will keep existing code working without having to touch any of it.  Also, I'm making the property read-only so it forces use of the constructor to use a custom configuration (constructor injection).  This creates a valid object at construction time.

The final step, for me, was to overload the CreateService method on my ServiceFactory to take an IServiceConfiguration parameter and will instantiate a new service app based on the custom configuration.  Again, to keep current code working, I will keep the old method that doesn't take any parameters so the "default" configuration will be created.


 public class ServiceFactory
 {
  public static IService CreateService(IServiceConfiguration customConfig)
  {
   IService serviceApp = new ServiceApp(customConfig);
   return serviceApp;
  }
  
  public static IService CreateService()
  {
   IService serviceApp = new ServiceApp();
   return serviceApp;
  }

All of this will get my tests to compile and after working through the tests I get them to pass.  This my seem like a lot to just refactor some of the code but there or more pieces to the code that I'm not showing for brevity sake.  The main thing is that now I have a flexible piece of code that can be used for load testing and other applications.  Two requirements met.  :-)

I also wanted to add that I've got a lot of code in place as this refactoring is happening.  Writing my tests and having all of my current tests lets me feel that I'm meeting the new requirements and not breaking anything that already works.

Giddy Up!


Posted in: Development & Geek Stuff  Tags:
Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2009 Erik Lane