Technical Debt

Technical debt is that chore that developers owe when they go back into old code. It’s the process of cleaning up or right sizing the code that they wrote to make it more readable, efficient and remove any dead code that is not longer in use. In my day to day I jump from project to project and recently I have re-engaged in a project to fix some defects and potentially add some little enhancements. I also consider that these times of re-engagement the opportunity to pay back some of the technical debt of deliveries gone by. Yesterday was one of those days where I was reacquainting my self to the code while offering up some refactoring. The funny things is even though I have been and software developer, engineer, architect and what ever other hat I wear for so long I still found my self once and a while feeling like I had a little bit of vomit in the back of my throat while reviewing the code. I am every grateful at the pliability of code and so thankful for Refactor, or R# for allowing me to easily and efficiently re-architect pieces and parts and a very forward and pragmatic way.

Question is, when you look at some of your old code, do you leave with a warm and glowing feeling, or do you feel a little sick and ache to be able to have a bit of a do-over. I suspect if you are a professional developer the later is the more realistic response. I really believe it is in all of our natures to say, if I knew then what I know now, or shit … if I just do this, or this this thing would work better, be less coupled, provide a better experience.

Its the trade off between time, money and resources, and going through the development cycle and initial time that  I suspect that will always leave us knowing that we can do even better given more time, resources.

Yesterday for me was a great day for handling technical debt, though it was long at 14 hours, by the end of the day I was happy with what was accomplished.

Entity Pages and XML Schema issues

I have been working with a SalesLogix business partner on a project for a while. A few nights ago I got a query from their developer with regards to an issue that they were having. While trying to implement a main view in the web client (known as an entity page) when they would navigate to the page and try to add a group it would fail with an nice and friendly message stating that the XML Schema was missing.

I have heard in the past that there had been some problems with the group builder functionality and started to investigate down that line. I even followed up on the blog provided by Ryan Farley at  CRM Developer . Finally I contacted some of my sources to understand how the feature was working and if there was some way to force a schema rebuild. Initially yet knowing the true issue I was told that I could force a rebuild of the schema by updating the datacode field basically reversing option 3 in Ryan’s post. Thinking that this was the right course of action I did so and unfortunately the page still would not render correctly.

I then dug a little deeper into the page’s setup to see if there was something amiss. In so 2 items came were identified as issues.

1. The page did not have a configured entity type

2. The page’s alias was not the same as the entity type it is hosting.

So the first issue was the big one. Given that the entity type was not set there was no way the group builder functionality could determine the base table/schema to resolve to. Once I set the page type correctly it was now possible to display the list view grid and build queries in the client.

The second issue was identified after enabling a column as a link column and trying to display the detail page. Since the internal resolution of the URL for a link is based on the entity type name if the page is no named the same as the entity it cannot be located. Once I changed the alias the page’s details were now displayable.

So when you make an entity page make sure that you set the entity type, and also set the page alias (name that the page is generated as) to the same name as the entity.

Cheers

Flying to Scottsdale for SalesLogix Boot Camp

As I write this I a flying into Phoenix to attend the SalesLogix boot camp. This weeklong event is to help business partners gain the experience and expertise of the SalesLogix web platform and all of its ancillary components. From what I hear its attendance is will exceed expectations. I am very excited to get to Scottsdale and meet with the other BP’s and of course all of my friends at Sage. I expect that today will be somewhat hard on my system as the start was not that great. I always have a hard time sleeping the day before a trip, but last night was exceptionally. We had decided (my wife and I) to get a hotel room last night to avoid the drive this morning, so not only did I content with the usual bout of insomnia but also the hotel noise, low quality pillows and all the other trappings of sleeping away from the comforts of home. The bright side was that the hotel offered park and fly service which means that we were able to park the car at the hotel for up to 3 weeks for free (hope the car is still there when we get back) and shuttle to the flight this morning. So it looks as if the staying at the hotel is going to have a net savings from parking at the Airport.

Arriving at the airport somewhat early (1.5 hrs) found us a pretty big line, luckily the AZ flight got some expedient service if you do not count the 10 minutes the ticket agent spent on the phone, and we made our flight with 10 minutes to spare.

I am thinking it would be nice about now to have a nap with roughly 2 hours still to go but that is but a dream, sleeping on the plane, definitely a no go.

As I mentioned earlier my wife joined me on this trip. It is her first time in AZ and I am looking forward to taking her to Sedona, the Grand Canyon, and maybe .. just maybe a drive up towards Las Vegas depending on how the schedules work out. My mind is currently buzzing with some feature updates to some of the products I work on. At times its very cool to always be thinking about how to make things better, or what’s next in the business but it can also be a little of a curse. It the strangest places and the most inconvenient times I find my mind wandering on the next great thing to do.

I am hoping that over the next week or so I can update the blog more frequently with information that is derived from each of the sessions. For those BPs who cannot attend there may bits of important information on the product(s).

Oh, bit of information here. I upgraded 2 computers during the week to windows 7. My main machine which I use for my day to day work and the notebook I am taking with and writing this blog on. The first upgrade went off without a hitch and is working perfectly fine. The notebook, though it did upgrade I had forgotten that I had installed VS2010 on the machine until logged in and noticed the menu items (usual do a VM). I uninstalled VS2010 and noticed that some of the programs failed to work such as SQL Server2005. Unfortunately I did not have time to ‘pave’ the notebook before my trip. My saving grace is that I develop using VM’s now (been working on the process) so I had some VMs specifically working for what I had to do this next two weeks. When I get back I will wipe the notebook and install the OS clean.

I do like what I have seen with windows 7 though.

Gone Windows 7

Now that Windows 7 has been released to MSDN subscribers I had decided to upgrade my main machine. I started the upgrade in the early evening and let it go as I had heard that I can take some time. I woke up to the final license key screen and now am happily using Windows 7. On another note I will be in Scottsdale AZ from the 16th to the 30th of August attending the Sage SalesLogix boot camp. I hope to see all of you business partners there as it looks like its going to be a great event.

Of Best Laid Plans of Mice and Men

I was thinking (as I do often) this morning about how the economy is effecting larger corporations, and as a side effect if it can be a benefit to smaller businesses and startups. Let me explain my thoughts

For the longest time my thought was that If I had invested into developing some product I would be concerned that some larger company with a larger bank roll could come in and build something and basically crush the market place for my product. I know cynical, but it has happened before to many small companies throughout history. However as we can see from what’s going on in the marketplace larger companies are starting to shutter business units that are not profitable. Put into perspective what is non-profitable to one company could be an excellent business for another. As an example if (I suspect) a business unit in MS is selling 10 million dollars in revenue of product X, this could be deemed as a non-essential business and be closed. However if a smaller 5-10 man shop sells 10 million dollars in revenue, this would be a great success.

The one problem I see with today’s software development industry is IP law when it comes to Patents. Fundamentally it is flawed in my opinion as the current system stifles innovation. You have heard this before but with the largess of patents issues and the quality of such patents being suspect you can understand how this system has become a runaway train. Think of it this way, I suspect throughout boardrooms, offices, kitchens and bars where ideas are conceived,  thought of what the legal complications will be to bring a product to market are hindering the development of new ideas and technologies. Smaller companies without the resources to go into battle with the larger patent trolls are crushed in a legal system, and those pressure resources are consumed buy nothing but destructive waists of time.

For example, the fact that there is a patent, any patent on XML seems ludicrous. XML is a text format that has well, text in it. Requesting and getting a patent on what is stored in there is nonsense. It was created to store any formatted text that crosses domains. If that data is uses as a database for one application, patient record information, or RPC data really should not matter as that is what it was created for. Though many apply for a patent to store their CRM data in XML, or Form Schema, or ….

I do not want to go into the companies just setup for Patent ownership and litigation,  but honestly that is a business that is not in the system for creation or innovation, but disruption.

Update

Its been a little while since my last blog and when life gets really busy the blog is the first casualty. When I started this year I had some high hopes to dig into some of the newer technologies and build so (IMHO) cool things. Technologies such as WPF as Silverlight, maybe jump into a new Language like F# and even give a try at some IPhone development. Though I have read business has kept be pretty much focused on SalesLogix web development and I have not been able to dig in to that meaty technical dinner like I would have wanted. I cannot complain about being busy at work but sometimes its nice to work in some of the newer stuff. It looks like the rest of the summer is going to be more of the same, except that I have started to take off some weekends to get some nice R&R especially while we have sun up here in Ontario.  I am looking towards the fall, and I suspect a new release of VS2010 to start to get myself into some new stuff. I have lots of ideas, I just need to work out the timing to get them to come to life.

I am still very much excited about Silverlight (with 3.0 coming) and I have been trying to get into a Class on WPF that has been cancelled more times then I want to remember. It seems that training budgets are being slashed all over the place and that is in itself putting pressure on the smaller guys given that the only training that can be had is onsite which as you can imagine is not cost friendly.

I also want to give a shout out to the guys at Telerik. I have done a project with them and they have a great group of people and their controls are fantastic. If you are looking into any 3rd party controls I am sure that they have something that will be just right for you.

So for now training remains as it has in the past, reading, browsing and building.

Have a great day

– Mark

Driving to Insights

I have been waffling between flying and driving to Insights this weekend. The final ‘Nail’ to get me into the desire to drive was when I did the hour budget. That is the time to Drive Vs. Fly and and add on comfort in the equation. When it looked as if either going or returning would have a 8 hour investment with flight heading down and 9 hour returning. With the estimates of driving being just a little over 11 it seemed like the right thing. And with the new car should be a nice ride. I have downloaded hours of content to listen as well as lots of music so I suspect the time will go by quite fast. I am hoping to actually get to the hotel tomorrow night as I have checked for availability and everything is good to go. Now to just get the my ducks in a row and packing done and off I go.

See you all there soon.

Unwrap that object my friend

Lately I have been seeing posts with regards to filtered searching inside of the SalesLogix web client. An example is the contact list where functionality is required to display only the contacts with a certain last name. I had to do this recently and had found the same issues that had been reported in the forums and newsgroups. The problem identified that properties in child entities were not resolvable when bound to a grid. After some head scratching, and inspection using visual studio debugger I noticed that the children were not being resolved (lazy loading) so I wrote a simple method to explicitly unwrap the entity to ensure that the children are resolved.

The simple helper method is as follows

static Sage.SalesLogix.Orm.EntityBase Unwrap(Sage.SalesLogix.Orm.EntityBase value)
{
   INHibernateProxy proxy = value as INHibernateProxy;
            
   if (proxy != null)
   {
      value = (Sage.SalesLogix.Orm.EntityBase)
           proxy.HibernateLazyInitializer.GetImplementation();
   }

   return value;
}
Now I will finally iterate through the resultant list in my query and add the result of this method call to a new list and finally return this new list instead of the one that was directly returned from the query.

var list = (IList)queryExecutor.List<IContact>(); // Gets the list from NHibernate

// New resultant list

IList result = new List<IContact>(); 

 

// Unwrap the entities and add to the new list

foreach (IContact contact in list)

{

   result.Add(Unwrap((Sage.SalesLogix.Orm.EntityBase)contact));

}

return result;

 

— Mark

A week till Insights

Next week the Insights business conference is on in Nashville. This is a time where I get to meet up with all my business partner friends and see the great people from Sage. Though I talk to many of them daily meeting up face to face, and having some social time is a great thing to do. I expect that the conference will be somewhat lighter in attendance this year in light of the economic downturn, and the unfortunate spread of the Flu of late. This will I expect equate to those who are going, to more quality one-on-one time with other BPs and with their Sage counterparts. I am hoping for a real ‘Geek’ out while there, having dinner with some of the trainers, and PSG guys and SE’s. I believe it is going to be a great time and I definitely look forward to seeing everyone there.

Custom SmartParts

Posted on slxdeveloper.com was a question on how to create custom smart parts for SalesLogix Web Client. Now I like custom smart parts, so much so that I find myself eventually going there quite often. You might say this is counter intuitive as you should just ‘Set it and forget it’ with the OTB form editor and data binding capabilities. This is where I somewhat deviate on that thought process. I find that the forms editor makes for me anyways a great prototype starting point where you can get the UI set up just so. But after its setup I find myself happily in Visual Studio making edits to clean up the generated code or have the smart part inherit some further base class to provide a deeper level of functionality.

I will continue happily work in both environments and really focus on getting the work done for the customer.