Tech Blog

Jay's Technical blog

Looking at Python...

26 July 2005
Jay Kimble

[WARNING! This is an archived post and as such there may be things broken/missing here.. you have been warned.]

I have decided to spend sometime learning Python.  I may actually have a small amount of time to do so over the next month.  The main reason is this article by Darrell. 

My hopes are that maybe I can write some Python for a quick problem solving session, and then use the code to write a design or whatever doc (if any) I need for the "Software Development Lifecycle" hell that I live in.... once I've solved the problem then I should be able to port back to VB or C# and move on.


E-mail Development Credentials or Why Jay is a Good Choice to Talk about E-mail

25 July 2005
Jay Kimble

[WARNING! This is an archived post and as such there may be things broken/missing here.. you have been warned.]

I'm in process with a How To Select Guide on e-mail (actually there are a couple of us CodeBetter bloggers involved in writing guides for other components).  I've actually written my first version and second versions.  The actual guide will be published sometime in September.

I decided that I would do a quick blog about my experience writing e-mail components (or mail server interactions), so that you can see what I knew about before writing the guide... I definitely had a few areas where I was a bit deficient, but I also had some strong skills that made me qualified.

Like many of you I have been using e-mail for so long I can't remember.  I touched my first component back in the mid 90s.  I believe the first components I touched was the old Crescent Internet Toolpak.  I also touched a bunch of others after that point.  Unfortunately, I never really did anything with the components.  I knew what they did and that was it.

Experience #1
A few years ago I was tasked with building a bulk e-mailing system.  I worked for a flailing dotCom that specialized in web site design and programming (how many of those are there).  Since I had great fears about my job, and I thought that it might make the company some money, I built the system.  At the time the cutting edge technique to bypass privacy was to put a hidden image on the rich email that would ping back to our web site any time a user opened the e-mail.  Since we didn't own an e-mail control I decided to write the entire SMTP client component from scratch.  To add insult to injury, our networking staff had a tendency to break our TCP/IP components, so I took an article I found that discussed using the raw Windows APIs to do TCP/IP, and built my own TCP/IP component.  On top of this control I built SMTP.  I also found very quickly that I needed to roll my own messaging component (hereafter referred to as MIME).  I needed my messages to include the "rich" email which was a flash file served up by our website, my image, and a text version of the message that would invite the user to go to the web site since their mail client didn't support HTML. 

Experience #2
In my present job I was asked to finish a service that monitors a mailbox on our Exchange 2003 servers.  I was told that WebDAV was the technology that would be used to do communications with the Exchange 2003 servers.  After finding a few bugs, and refactoring the code to have some semblance of an object model, I discovered that I needed to touch the communications layer.  I learned Exchange's WebDAV syntax and learned how to query Exchange.  Very cool stuff!

Obviously I hadn't done much programming with POP3 or IMAP4 (or even MAPI for that matter), but I did have knowledge in the protocols (just no actual programming experience). 

BTW, I have also done the normal use of the Persits COM object as well as the standard e-mail components that Microsoft supplies (BTW, they suck!  If you like System.Web.Mail go to http://www.systemwebmail.com for some interesting discussions about System.Web.Mail... it's borderline unusable IMNSHO).

[now I can go back to spelling e-mail "email..." the standards for the guide say "e-mail" is the correct spelling]


Where has Jay been

24 July 2005
Jay Kimble

[WARNING! This is an archived post and as such there may be things broken/missing here.. you have been warned.]

This is a quick personal (kind of) post.  I just wanted my regular readers to stay tuned.  I will be back (am back).  I've had an extremely busy couple of weeks.  I'm writing a guide for the How TO Select Guides on Internet E-mail components, have been extremely
busy at work, and tie down pretty heavy by life. 

My e-mail guide is just about finished.  I covered 35 different packages, and generally had a lot of fun while busting my butt writing.  My guide is slated to be released sometime around September (although it may be delayed).  I knew a lot about MIME and SMTP, but gained a lot more knowledge in the area of IMAP4, POP3, and S/MIME.  I also had recently used WebDAV with Exchange at work.  Very cool stuff!  BTW, I really like IMAP and if given a choice in the future I will not hesitate to use it.  IMAP seems to be a good protocol for apps that need to monitor a mailbox; it assumes that you are going to be reading the mail while online, so all the mail folders and mail exist on the server (not on the client).  POP3 seems like a great solution for people accessing a mail box; all the mail exists in a single folder and the protocol assmes that you will be downloading the mail and reading it offline.  I know you probably know all this, but it's still pretty cool.

Oh yeah, in case you don't realize we cover both open source and closed source packages.  We even review FreeSMTP by QuikSoft which is a free SMTP (send mail) component that can be used non-commercially.  We also have a feature chart that has 65 different features listed with an indicator for each of the 35 products (all 65 will probably only be available on the online version of the guide).

I'll be starting another guide soon on Data Reporting and Analysis components... that's going to be an interesting guide to write.

I promise to write a little more often again.  Oh yeah, I have a month's worth of posts in my head...  a couple will be on client-side XSLT for those situations where you have a lot of data that you want to drop down to the browser... I wouldn't want you to simply use AJAX for that.

I also have another post on my credentials that make me competent to write about e-mail components.

I'm working on an add-in for VS.Net that will give VB-ers an IDE feature that is only found in C#.  (BTW, it is a feature that is kind of taken care of in vs 2005... but we still have a few months for that).  Oh yeah, I'm really good at announcing junk and then not delivering.  I could almost release this one now.  I will need some help figuring out how to release the source (I'm not maintaining a project that is for sure).


A new approach to Code Generation...

08 July 2005
Jay Kimble

[WARNING! This is an archived post and as such there may be things broken/missing here.. you have been warned.]

[I've been busy lately; sorry I haven't blogged much.  Working For the How To Select Guides has kept me pretty busy].

During the whole ORM debate on my blog here, both Frans and Paul Wilson pointed out a couple things with using tools like CodeSmith that I have been pondering (BTW, if I haven't mentioned it I love this CodeSmith! Intellisense Rocks!).  Paul mentioned that he truly believed that O/R technology was superior; he did accept that there may be ways that templating could achieve some of the same effect (he also admitted that he had never seen it happen because there is always maintenance).

I've been thinking about all this and I have been pondering ways to make my templated code more maintainable or better yet, get things to a point where I somewhat don't have to maintain code at all.

The idea I have come up with to create a CodeSmith template (I'm sure this can be done with other templating tools like MyGeneration) that let's me build CodeSmith Templates.  So in my current Data Access Layer templates I end up with the following classes (sorry this won't be full blown code):

Class sqlSomething
 ' Constants containing stored proc names, parameters, etc.
 
 ' Actual Calls
 Public Shared Function LoadSomethingData(param1 as int, param2 as string, etc....) as SomethingData
  ' Code would go here
 End Function

 Public Shared Sub ActionNameSomethingData(param1 as int, param2 as string, etc....)
 End Sub
 
 'Additional Stored Procs will follow
 
End Class

'-------------------------------------------------------

Class SomethingData ' Business Object
 ' Properties that hold values
 
 ' plus fromstring/ToString methods to read from/create a pipe delimitted array of data
End Class
'-------------------------------------------------------

Class SomethingCollection ' Collection of SometingData
 Inherits BaseCollection

 ' Code goes here
End Class
'-------------------------------------------------------
Class SomethingController ' Singleton that contains all
     ' the actions against the bus. object or the collection

 Public Shared Function GetInstance() As SomethingController
 End Function

 ' Actions
 Public Function Load(param1 as int, param2 as string, etc....) as SomethingData
  return sqlSomething.LoadSomethingData(...)
 End Function

 ' Additional Actions that call a stored proc and use a SomethingData object
End Class

My CodeSmith template builder template would simply accept a collection of some new type.  The new type would contain an action name, and what type of data that action would retrieve (does it return an object, value -- first field, true if there's a record, etc.-- or no value at all).  [I guess it might be possible to do this without a template generator]  The actual template generated would have properties/parameters for each action defined and would build code that knew whether that method produced an object, a value, or was simply a sub (void to you C#ers).

I could then archive this generated template with my code and if something changed like a field changed in the database I could simply regen from my saved template and move on...  I may still need to work with the frontend (but that always happens... I could at least minimize the effect).

What do you guys think?