CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Eric Wise

Business & .NET

May 2005 - Posts

  • Blogger Experts

    Silly rabbits, there are very few methods out there that you can point to and say "That's the one".

     

    The wonderful thing about programming is that there are many ways to get to point B from point A.

    The wonderful thing about blogs is that you can often find several ways to get to point B from point A.

    The wonderful thing about a skilled developer is that they can parse through these ways, test them out, and figure out which one makes the most sense to them for the problem worked on at the time.

    The wonderful thing about the community is that they can make you aware of caveats or new ways of doing things.

     

    At the end of the day, when the end user comes a calling, the application better work.  In the end the average customer could care less whether you used only stored procedures or dynamic SQL, whether you used brand x object mapper or not.  Do your work the best you can, share the good stuff with the community, and always put your customers above the personal bias of the community and yourself.

    The whole key to getting benefit from the community is to not blindly follow advice.  Apply and understand the examples you find.  Examine everything carefully.  To do otherwise would be like buying a house without looking inside it...

  • Friday fun

    I am a Gauntlet Adventurer.

    I strive to improve my living conditions by hoarding gold, food, and sometimes keys and potions. I love adventure, fighting, and particularly winning - especially when there's a prize at stake. I occasionally get lost inside buildings and can't find the exit. I need food badly. What Video Game Character Are You?
  • More Of Why Asset Management Is Important

    As all my loyal readers know, I'm mere weeks from releasing Easy Assets .NET and so a lot of my focus is now turning towards marketing and sales.  Remember that the goal of proper Asset Management is to save you and your techs using the help desk feature time and effort when working with your assets.  This sounds alright on paper, but let's throw some real numbers against it:

    Scenario 1: The Small Business

    Let's take a look at a typical small business with a pretty low cost per employee:

    Total Employees: 50
    Incidents / Employee / Year: 12
    Cost of Employee Downtime: $40/hr
    Downtime Per Incident: 60 minutes

    So 50 employees, each having ~1 incident per month with a downtime of 60 minutes.  We're assuming all employees cost $40/hr which is definitely low.  With this scenario though your business will have the following costs:

    Total Downtime / Year: 600 hours
    Total Cost Of Downtime: $24,000

    Now if you're properly using an asset management system you have all your serial number, support history, and vendor contact info instantly accessible by your techs.  Let's say that this saves your people a mere 15 minutes of time spent digging through records and asking users to climb under their desk to get tag info.  Bottom line is that 15 minutes when applied across all incidents turns into $6,000 in savings.

     

    Scenario 2: The Medium Business

    Let's take a look at a typical medium business with mostly higher cost, white collar employees:

    Total Employees: 200
    Total IT Techs: 2
    Incidents / Employee / Year: 12
    Cost of Employee Downtime: $60/hr
    Downtime Per Incident: 60 minutes

    So 200 employees, each having ~1 help desk incident per month with a downtime of 60 minutes.  The employees in this situation have a more realistic (US) cost of $60/hr.  With this scenario though your business will have the following costs:

    Total Downtime / Year: 600 hours
    Total Cost Of Downtime: $144,000

    Now if you're properly using an asset management system you have all your serial number, support history, and vendor contact info instantly accessible by your techs.  Let's say that this saves your people a mere 15 minutes of time spent digging through records and asking users to climb under their desk to get tag info.  Bottom line is that 15 minutes when applied across all incidents turns into $36,000 in savings.

     

    You can quickly and easily apply this math to any organization.  Bottom line is that if you use my product properly you're going to shave precious minutes off of your asset support time and you can see in the above scenarios how much those minutes can add up to over time.  In the end, that's what I think a successful business is all about, providing a value (ROI) that is much greater than the cost.  If the company in scenario #2 were to purchase my most expensive package, their ROI would be 18 times what they paid.

  • Build vs Buy - Reporting

    Here's a good example of where build vs buy kicks in: One of the developers I'm mentoring was tasked with writing a summary report that had 3 groupings.

    Since the company currently has no reporting software, the poor junior developer was trying to have a datagrid in a datagrid in a datalist and juggle the sub querying and binding of all 3 at runtime.  At the rate things were going he had already spent more than a day on a report that a decent tool could have whipped up in less than a few hours.

    We can't have that, so I had the company buy a few licenses of XtraReports Suite which should be arriving today.  I'll blog my experiences with the product soon.  I've played with the product before with some success, but I'm interested to see how the junior developers react to it.

    Either way though, this solution shouldn't have the maintainability nightmare that was being worked on before. =)

  • New Site Is Up

    In preparation for the standard and enterprise launch I've reworked the website with the help of graphic designer extraordinaire Brian Lanier.

    You can view the site at http://www.easywebapps.com.  I'm very pleased with how it turned out.

     

    Brian is available for freelance work, you can hit him up here:

    Brian C. Lanier - Design work of all types - 3D, Web, Corporate Identity

    brinskee@yahoo.com 

    www.lizwatkins.cc/blanier/

  • Rethinking Compensation II

    My previous post got my wheels really turning over how I would design a compensation system if I were in charge of a large corporation.  Basically, there are 3 components of a total benefits package which are salary, tangible benefits (medical/health, vaction time, etc), and intangible benefits (environment, tools, coworkers, etc). 

    First, a brief rant on fiscal responsibility

    Some people have skepticism about my post that the wealthy owners of corporations do not care enough to provide a great package to their employees.  Whose fault is that however?  It's certainly not the employer's fault.  It's our fault.  That's right, you heard me loud and clear, it is our fault.  Why is that?  Well it all boils down to our lifestyle choices.  America has one of the lowest personal savings rates and highest consumer debt ratios in the world.  Our interpretation of the American dream is that because we are Americans we are entitled to a big house, fancy cars, big screen TVs, and other such luxeries.  The consequences of this belief is that every time many people receive a pay raise, they increase their lifestyle to eat up that raise.  What this does over time is make you even more dependent on your salary then you previously were.  If every time you got a raise you immediately earmarked 50% of that raise to go into savings and investements, you certainly wouldn't have much fear of losing your job anymore as your savings would support you.  Think of it this way, all you young developers out there, if you enter the market at the standard wage for IT, around $30,000/yr, chances are that if you stay in the field after 5-7 years your salary will be in the $50,000 - $75,000 range... meaning that if you agreed to save 50% of your wage increase and only use 50% to increase your lifestyle you would be banking $10,000 - $22,500 / yr in that 5-7 years experience range.  You could pay CASH for a $200,000 house by the time you were 35.  However, if instead you decide to spend every nickle you earn, then you'll be in great fear of losing your job and going bankrupt, and you'll find yourself taking jobs and doing work that make you miserable, accepting situations without a choice, and it's your fault.  And keep in mind the numbers I just quoted don't take into account interest earnings, you can find perfectly safe interest accounts paying 3%.

    Compensation should be like customizing a racecar in a video game

    Customizing your race car in a video game was the closest metaphor I could come up with.  For those of you that aren't gamers, I'll explain.  Many games allow you the option to customize your race car before the start of the game.  Customizations generally include upgrades to speed, steering, shocks, and other features important to a race car.  You only have a limited amount of "points" that you can spend on your upgrades, which means that if you increase one stat, the max of the others drops, so in essense you could dump everything into speed and have the fastest car on the track, but your steering and shocks would suck.  Depending on what type of racer you are, you'll favor some stats over others, and adjust your car accordingly.

    Ok smartguy, how does this relate to compensation?

    Well, the first thing businesses have to recognize (they are getting better at this, no matter what Jay thinks) is that workers are individuals and should be treated as such.  As individuals we have different needs.  Those of us who are young and just starting out in the field have needs for money, experience, and power.  Those of us who are older with families have different needs like time with our families, personal reflection and growth, and managing our affairs.  With this in mind, I've been thinking about structuring employee compensation just like in the video game.  Upon hire, you would get a "base" compensation package like such:

    Title: Junior Developer

    Salary Base: 25,000

    Total points: 100

    Base benefits:

    * 5 paid vacation days

    * 50% paid health insurance

    * 5 sick days

    * Fitness club discount

    * $2,500 / yr education benefit

     

    With this as the base package, you'd then offer one to many additional benefits that would cost points, from above:

    * Additional $1,000 salary - 10 points

    * Additional paid vacation day - 5 points

    * 10% more paid health insurance - 3 points

    * Shortened work week (less 4 hours) - 20 points

     

    On and on it would go, listing out additional benefits an employee could have.  It would be the employees job, on acceptance of the offer, to distribute their points into benefits that are important to them.  Only care about money?  Then dump all your points into salary and give yourself a $10,000 raise.  Want more time off?  Buy a day off work and 12 more PTO days.  You'd be able to re-evaluate your point distribution annually just like now in companies that let you change health plans at the end of the year.

    I think this would be completely fair to workers in all walks of life since they could adjust their compensation to meet their needs.  Employees wouldn't be jealous of the "part timers" as Darrell fears, because everyone has the option to get more time off or a shorter work week, if they don't take it or decide money is more important then that's their business.  The only place which might be tricky is the shortened work week because it would have to be scheduled around the needs of the customer, because they always must come first.

    Anyone want to work for me?  *chuckle*  Maybe if Easy Assets and my consulting services grow a bit more I'll be hiring with this compensation plan.

  • Rethinking compensation

    You know, I've had many conversations in the last few months about compensation with my contacts, and I have hit upon a common theme.  Those of us who have experience, confidence, and ability seem to agree with the following statement:

    "I would take a paycut to work less hours"

    Yes, there is a magic time and place when your experience level and salary reaches a point that suddenly the money doesn't mean as much.  You want to spend more time with your family and kids.  You want to pursue other interests.  Bottom line, you want to develop yourself in directions you've never had the opportunity for when constrained by a full time job.

    So here's a tip for you businessmen out there.  If you're looking to hire someone in that hard to fill sweet spot, the 3-7 years experience developer and you're strapped for cash... why not offer to let any employee who wants it to take a 15% paycut and take fridays off?  Or let employees schedule as much unpaid vacation time as they want as long as they clear the time in advance?

    How many of you would take a paycut for a shorter work-week?

  • Coming Soon...

    Hey, if Sahil can post a book cover, I can post a product box.  =)

  • Why Asset Management Is Important

    Sahil asks on this post:

    "Since most of your audience are computer geeks, how about an english friendly, non-mba description of what "Asset Management" is .. and why should I care?"

    Well, the MBA description isn't so bad.  So here's a small business lesson that is common sense, but important to the concept of Asset Management.  You see, a business is designed to make money.  Duh right?  Well, once you are operating a business, there are two main ways that you can make more money:

    1. Increasing revenue/sales.
    2. Lowering costs.

    Asset management focuses on #2.  At its most basic description, Asset Management means simply keeping track of all of your "fixed assets".  Fixed assets are real property that your business owns, it can be anything from vehicles to computers to the chair that you are sitting on right now.  Easy Assets .NET is designed to help businesses lower their daily operations costs.  Properly used, there are many ways in which this is possible.

    Purchasing

    Cost savings in purchasing break down into a few ways:

    1. How can you know what to purchase if you don't know what you currently have:  Being able to quickly search through your asset database allows you to view assets for the entire company, by department, etc to determine which assets are getting old and are up for replacement.
    2. Software License compliance:  This is becoming a major problem for organizations that do not keep track of their licenses.  You can be fined big time for installing software on more computers than you have paid licenses for.  In Easy Assets you can assign parent to child relationships between assets .  For example, you can create a microsoft office license asset record and assign it to a Dell pc.  If you buy another Dell pc and search for a ms-office license none will be found (because it's already assigned).  This immediately lets you know that you're out of licenses.
    3. Keep track of purchasing information: Asset records can be generated from purchase orders, or you can explicitly put purchase price information into the system.  This can be a quick lookup for you to recall how much you've paid for assets in the past, and in the case of evaluating new vendors, comparing prices.

     

    Accountability

    It is in the best interests of your company to know who has which assets and make employees aware that they are accountable for their assets.  Easy Assets allows you to assign assets to departments and employees.  Doing this allows companies to keep tabs on their assets and should something turn up missing, they know who was responsible for the asset.  I've seen cases where a company is re-organizing and they open a closet and find a pile of old pc's and monitors and no one seems to know that they even existed.  With the proper use of an asset management system these assets would be showing up in your queries and would not be forgotten.  Your accounting departments will love this since they need information like this to depreciate and/or dispose of assets that are no longer useful.

     

    Contracts and Warranty Information

    Most things you purchase come with a limited warranty... but how many of you actually keep those warranty insert cards?  Now the few of you that do, how quickly could you pull that card out of filing if you needed information off it?  Most companies have service agreements with local repair firms.  Do you know the terms of those agreements off the top of your head?  Do you know which assets are covered by the agreement?  Are you notified when warranties or service contracts are running out?

    Bottom line is that reparing an asset once it is out of warranty is very very expensive.  So tracking this information properly in a program like Easy Assets allows you to keep tabs on this information and never be caught with a broken asset with an expired service contract.

     

    Track Maintenance Costs (ROI)

    ROI is one of those MBA terms Sahil hates, it means "Return on Investment".  To break this concept down simply, think of your office printer.  If you paid $500 for the printer, you could estimate just about how much benefit ($) you get from running print jobs.  What most organizations don't track, however, is the costs associated with maintaining that printer.  Printers break, they jam, you have to call in service techs.  If you're not keeping track of the time you're spending doing this, how can you know whether keeping that printer is a good investment? 

    This is where the helpdesk feature of Easy Assets comes in.  You can create an issue ticket for that asset, and the tech that completes the job can record the number of hours spent repairing it.  The asset details shows all the historical tickets and there are several reports that show aggregate data for # of tickets and # of hours by asset type.  This allows you to answer some questions to save you money:

    1. Should I replace an asset: In the case of the printer above, lets say you have a cost associated with tech work of $70/hr.  Over the last 6 months, you have had to have the techs fix the printer 4 times, at an average of 3 hours per support ticket.  That's 12 hours of support at $70/hr, or $840.  So guess what?  You have been spending more than 50% of what the printer was originally worth.  You should get rid of it and purchase a more reliable printer!  Having these numbers in your hand tell the business that even if you spent $1340 on a better printer, you would break even as far as your costs.  Those of you out there who complain about having poor equipment in the office... hard data like this can convince your superiors to buy a better product!
    2. Dealing with vendors: When that printer vendor comes calling trying to sell you more equipment, slap them with the above data.  You have evidence that their product was a poor purchase decision and this gives you power over the vendor.  Make them give you a better service contract if you can show that their product is troublesome, find a new vendor if not.  Information is power!
    3. Staff Training: What if you find that the vast majority of your helpdesk tickets are your office people having trouble with a certain software package?  By being able to track and run reports on where most of your problems are coming from you can draw conclusions about where better training for your end users will be more cost effective than the time you're spending handling their support tickets.
    4. Know when not to buy coverage: Vendors are always pushing expensive maintenance contracts at you.  However if it is a product that you see in reporting that has had few or no problems over its life, you can make the judgement call to not extend coverage and spend that money elsewhere.

     

    Insurance Savings

    Collecting insurance in case of a disaster can be quite a trying process.  The insurance provider will want model numbers, serial numbers, purchase information, photographs... generally the more information you can provide the insurance provider about your assets the more likely you are to get reimbursed for that asset.  A good asset management system is a great "cover your ass" investment.

     

    Government Reporting

    As budgets continue to tighten for schools and government agencies, I can almost guarentee you that the reporting requirements for these organizations to the state/fed will increase.  Odds are, if you get government funding, you'll have to start providing this data, if you aren't already.

     

    So as you can see, when properly used there are many ways which you can lower the costs of doing business.  Proper asset management will more than pay for itself over time, it just takes the discipline to create a process and stick with it.  I'm sure there are plenty more creative ways to save money using this data, this is just an off the cuff list.

  • Images, Thumbnails, SQL Server, and ASP .NET - Level 200

    Ok, it's been a bit of time since I posted some technical content.  I seem to be the only codebetter blogger who has big business aspirations and is launching a real ISV so I've been trying to mix that content into the Codebetter feed for those of you who have similar aspirations.  I think it's time to get back to some technical content though.

    Using SQL Server to manage images (or other files) is a frequently asked question of mine.  I have come across several clients in my consulting career where they were simply dumping the files into a physical directory on the webserver.  In the end, this is pretty sloppy and difficult to manage especially if for some reason you want to reorganize the data.

    In this article I will show you the Easy Assets .NET method of handling image uploads.  The application allows clients to store images of their assets, mostly for insurance purposes.  I had a few goals for this section of the application as follows:

    1. Store images in sql server for easy management on my end.
    2. Automatically compress images so I don't have to worry about disk space usage or demand that my users compress it themselves which can be hard for a user without computer savvy (once again, EASY assets .net)
    3. Generate thumbnails for display in a list.

    Step 1: Configuring SQL Server

    First thing we must do is set up a SQL Server table to handle the data.  SQL Server has a handy image field to handle this type of thing.  Here's the table we'll be using in the example:

    CREATE TABLE [dbo].[AssetImages] (
        [AssetImageID] [int] IDENTITY (1, 1) NOT NULL ,
        [AssetID] [int] NOT NULL ,
        [FileData] [image] NOT NULL ,
        [FileName] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
        [FileSize] [bigint] NOT NULL ,
        [ContentType] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
        [Thumbnail] [image] NOT NULL ,
        [LastEditUser] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
        [LastEditDateTime] [datetime] NOT NULL
    ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
    GO

    The main image will be stored in the FileData field and the thumbnail image will be stored in the Thumbnail field.

     

    Step 2: Compressing the image

    To compress the image, I used the handy tool I mentioned in this post.  You simply register the dll, and drag and drop the compressor tool onto the page.  The following code uploads an image from the html file upload object, compresses it, and then generates a thumbnail.  It uses my domain pattern, like all pages in Easy Assets .NET.

        Private Sub btnUpload_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpload.Click
            Try
                Dim upfile As HttpPostedFile = UploadFile.PostedFile
                ' Make sure there's actually content uploaded
     
                If upfile.ContentLength <> Nothing Then
                    Dim myData() As Byte
                    Dim stream As New MemoryStream
                    Dim assetImage As New EasyAssets.DAC.AssetImage
     
                    myData = ImageOptimizer1.Optimize(upfile)
                    assetImage.FileSize = Convert.ToInt32(myData.Length / 1000)
     
                    Dim i As Integer = InStrRev(upfile.FileName.Trim, "\")
                    If i = 0 Then
                        assetImage.FileName = upfile.FileName.Trim
                    Else
                        assetImage.FileName = Right(upfile.FileName.Trim, Len(upfile.FileName.Trim) - i)
                    End If
     
                    assetImage.AssetID = Convert.ToInt32(Request.QueryString("AID"))
                    assetImage.FileData = myData
                    assetImage.ContentType = upfile.ContentType
     
                    Dim thumbnail As Bitmap = CreateThumbNail(New Bitmap(upfile.InputStream, False), 120, 120)
     
                    thumbnail.Save(stream, ImageFormat.Jpeg)
                    assetImage.Thumbnail = stream.GetBuffer()
     
                    DomainManager.Save(assetImage)
                    BindDataGrid()
                End If
            Catch ex As Exception
                WriteMessage(ex.Message, True)
            End Try
        End Sub

    Few things to note:

    1. Filesize / 1000... default is bytes, I convert it to kilobytes.
    2. Bitmaps and memory streams are pretty cool, I know that the bitmap has a thumbnail creation method on it but I've heard that it doesn't do a nice job.  I found the following code on a MVP's site, sorry to whoever it was, I cleared my history and lost your blog.  Contact me and I'll give you proper credit.
        Private Function CreateThumbNail(ByVal postedFile As Bitmap, ByVal width As Integer, ByVal height As Integer) As Bitmap
            Dim bmpOut As System.Drawing.Bitmap
            Dim Format As ImageFormat = postedFile.RawFormat
            Dim Ratio As Decimal
            Dim NewWidth As Integer
            Dim NewHeight As Integer
     
            '*** If the image is smaller than a thumbnail just return it
            If postedFile.Width < width AndAlso postedFile.Height < height Then
                Return postedFile
            End If
     
            If (postedFile.Width > postedFile.Height) Then
                Ratio = Convert.ToDecimal(width / postedFile.Width)
                NewWidth = width
     
                Dim Temp As Decimal = postedFile.Height * Ratio
                NewHeight = Convert.ToInt32(Temp)
            Else
                Ratio = Convert.ToDecimal(height / postedFile.Height)
                NewHeight = height
     
                Dim Temp As Decimal = postedFile.Width * Ratio
                NewWidth = Convert.ToInt32(Temp)
            End If
     
            bmpOut = New Bitmap(NewWidth, NewHeight)
     
            Dim g As Graphics = Graphics.FromImage(bmpOut)
            g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic
            g.FillRectangle(Brushes.White, 0, 0, NewWidth, NewHeight)
            g.DrawImage(postedFile, 0, 0, NewWidth, NewHeight)
     
            postedFile.Dispose()
     
            Return bmpOut
        End Function

     

    Step 3: Binding thumbnails to a datagrid

    Now, by default, you can't really show image data from sql server into a datagrid, so we have to sort of "trick" ASP .NET into inserting an image into the grid.  We do this by calling a special aspx page into the template column of the grid.  Here's how it works:

    First, set up the template column of the grid as such:

    Notice the call to the two pages, on click of the thumbnail I want to show them the full-size version of the photo in a popup window.  The thumbnail is bound to a function called "formaturl" that takes the id of the image as a parameter.  Let's take a look at this function:

        Protected Function FormatURL(ByVal imageID As Integer) As String
            Return ("AssetShowThumb.aspx?id=" & imageID.ToString())
        End Function

    So basically we have told asp.net that the source of this image is the results of the AssetShowThumb.aspx.  But what does this page do?  Let's take a look:

        Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            If Not Page.IsPostBack Then
                Dim assetImg As New EasyAssets.DAC.AssetImage(Convert.ToInt32(Request.QueryString("ID")))
                assetImg = DirectCast(DomainManager.Load(assetImg), EasyAssets.DAC.AssetImage)
     
                Response.ContentType = "Image/JPEG"
                Response.BinaryWrite(assetImg.Thumbnail)
            End If
        End Sub

    So all we've done is load the image record, set the content type to jpeg (I force all saves in the above function to be jpegs), and binary write the image data.  We end up with a display like this:

    And an original image (on click of thumb) like this:

    And oh how I wish this picture, from my hawaii trip, was actually an asset of mine. =)

  • Easy Web Applications : Consulting Services

    <LifeUpdate>

    I know I haven't had much in the way of updates for my ISV for a while, but I've been crazy busy:

    1. I have the project I'm finishing up now (http://www.ihomeschool.com is the marketing site, my team is building the application)
    2. I'm working on a few jobs for some contract clients of mine.  Over the past 6 months I've been using supplemental contract work to build relationships with subcontractors, offshore firms, and banking some cash for expanding my own operations which will hopefully involve hiring some of my subcontracts on as full time employees.
    3. Still putting the finishing touches on Easy Assets .NET... the really positive news is that even though it hasn't been officially released yet I already have several clients using the hosted beta and feedback has been extremely positive.  My accountant thinks my pricing structure is too cheap compared to the market rates, so I need to figure out if I should raise hosting prices or not.
    4. Buying a lot and building a new house.  Housing prices are so expensive now that I've found that I can build new for less than the price of a 20 yr old house with the same square footage.
    5. Finishing up my MBA
    6. Spending time with my Wife and new son (7 weeks old now, already a nerd, he loves listening to "They Might Be Giants" music)

    In addition, since being a member of Codebetter has given me access to some really talented developers, I've started working on expanding my company's consulting services/custom development department.  So yes, now you can have a project run by a CodeBetter developer (me) and possibly get some cameo work from some of the other developers on this site.  In addition, I have my own contractors and relationships with several developer shops both onshore and offshore. Being that my base of operations is in the Midwest where we enjoy such a low cost of living, you'll find our rates are pretty damn good compared to what you get from major market areas (NY, DC, LA, Chicago, etc).  So if you or any companies you know need some quality .NET work done, I now have quite a few ways to meet your needs. 

    </LifeUpdate>

  • Domain Manager Pattern

    Since december, my domain manager pattern has been tweaked in a few places to make it a little more sturdy and support composite keys, etc.

    I've updated my original HowTo article

  • Here's a nifty free tool

    http://www.paymon.net/Pages/Show.aspx?page=17

    Image compression tool for those of you who want to allow users to upload large images without having to have the user go through the pain of compression.  In a test it chunked down a 1.2mb image I uploaded to a mere 50ish kb.  Image still looked good when displayed as well.  The tool was very easy to configure and use.

    Look for an article this week from me about image upload, generating a thumbnail, store/retrieve image data from sql server in Easy Assets .NET.

    Yeah, I suppose I should mention that I'm adding a feature to assets to allow pictures to be stored for insurance purposes.

  • Scott doesn't use datasets in ASP .NET Applications

    Scott doesn't.  I do... sometimes.

    I generally prefer business objects and collections thereof for a good chunk of my ASP .NET applications.  This is mostly because by extending business objects with properties, methods, and events I can gain a level of control that isn't possible with the dataset.  Using a datareader to populate these objects is fast and easy.

    However... in the case where I am just displaying data, such as binding results to a combo box or showing a summary grid, I tend to use a datatable or dataset.  But why?

    1. I don't want an open connection/datareader in my UI layer.  I believe in separation of code into logical layers which means that binding a datagrid directly to a datareader is a no-no.  Fetching a datatable/dataset from the database layer is fine though.
    2. There is a reduction in the amount of code you have to write to populate and kick back a datatable rather than a dataset.  In fact, if you are calling a stored procedure, you can even tweak the fields passed back without editing the code in the datalayer, the datatable will populate all the results automatically.  In the business object/collection world you'll have to tweak the code in the stored procedure, the data layer, and then the UI.  With datatables you can eliminate a step.
    3. Aggregates, joins, and sorting!  Much MUCH faster and more efficient to let SQL Server do this than to force your webserver to do this walking collections, etc.  Not to mention the added complexity of handling collections in collections in collections to represent joins in a business object.  Congratulations, you just added a ton of code complexity to determine when to populate the object and its joins or just populate the object.  People that use lazy-loading without thinking end up with hundreds of database calls for a single grid bind when they refer to properties that require a lazy load in the grid.
    4. Is populating a collection of objects really that much more performant that populating a datatable?  I doubt it... either way you're walking data and inserting records into an object.

    So there you have it.  I'm not against business objects/collections.  I freaking love them... however, if you're just displaying data, not using any business logic, then it is my opinion that you are far better off passing out a datatable/dataset than trying to do SQL Server tasks inside your business objects.

    Perhaps Sahil or John Papa can supply statistics for #4 and #5.  I have little patience for such measurements.  =)

    Update: Here's a link to some datareader vs datatable stats: http://www.devx.com/vb2themax/article/19887/1954

    Shows that the datareader is far more performant as you add more and more data.  One caveat here before people glance and freak out at the difference: As a commented above, I use the datatable to show summary, join, you know... special data.  The article shows how performance degrades all the way up to 10,000 records... realistically you should never be displaying a client more than 100-200 over the web if not for performance purposes but just readability.  It's just too much information for the average human to process easily.  If you feel like you have to show 10,000 records I suggest an alternative solution involving lots of filters.

  • When you have a plumbing problem, hire a plumber

    I'm a big believer in letting the specialist do what they do best.  I think that a lot of problems in the IT world are caused by people who want to be all things to everyone.  It is important that we realize that although we may have a broad skillset and understanding (basic understanding of all pieces of an application is vital!), it is important to realize when certain tasks are better off handled by a specialist.

    In setting up and launching my ISV I've learned this lesson in spades.  For example, take my website.  Granted, it is very clean and easy to read, but definately does not have any sort of "wow" factor to it.  I set this website up on the cheap doing much of the work myself.  Here's a screenshot of it:

     

     

    Now jump ahead to me nearing the launch period for Easy Assets .NET.  I look at my website, which needed to be reworked on content since I'm adding products and a purchasing/registration interface and I decided that I wasn't all that satisfied with how the site was looking.  I bit the bullet and hired a professional designer to rework the look and feel of the site.  Here's what he came up with in less than a week:

     

    Personally, I'm thrilled with the way the site is turning out.  Professionally, I'm kicking myself for not just hiring a designer in the first place.  I spent more of my valued "time" working on the original site than I paid a professional to do the job.

    Here's the contact info of the designer.  Just be sure you let him know you found him here.  ;)

    Brian C. Lanier - Design work of all types - 3D, Web, Corporate Identity

    brinskee@yahoo.com 

    www.lizwatkins.cc/blanier/

More Posts