Sunday, March 15, 2009

Chapter 18 shopping cart...not really

Chapter 18 claims that it shows you how to add a shopping cart to a web site similar to the one created in chapter 17. This is not true. This chapter is heavy on programming in VB, defines classes and shows you controls to use the methods of the classes you make and view the data, kind of. It does all of this without teaching you programming. As a programmer I can see whats going on: you have files where you create classes and the methods, although not as elegantly as with netbeans ( no auto-creation of getters and setters and all that other cool stuff netbeans makes easy); It shows how to use a data object similar to the ones used with a database that can attach to or call the functionality of a class, create an instance of that class and call the classes' methods.

It's just like the section on creating and using web services but adds the functionality of one control, the data view control that calls methods. It's totally a dumbed down version of what I already learned. The shopping cart system is not encapsulated in any easy to use or set up controls as one would expect nor does this chapter get into any of the details of how to actually apply or accept payment, do payment confirmation, or update your inventory! Its rediculously stupid. Probably because I'm missing some point, but I dunno, maybe it really is just stupid.

If I were to do this I would use the services framework. I would create a whole self encapsulated set of shopping cart classes with all kinds of cool methods. Make display methods that are easy to export to a website, similar to what they showed me here but better and as part of the shoppingcart class. I would have a set of classes with methods for inventory, inventory controls and updates. I would have the checkout class and methods that upon payment receipt and confirmation would run the inventory update methods, among other things such as updating sales records databases. In this way I would be taking full advantage of object oriented programming so that I can make any page I want for any user, customers, managers, sales clerks, whatever to use to look up prices, update prices, query sales volume and profit and whatever.

The single puprose programming of this chapter that hard codes functionality into controls that are difficult to update, move around, and control goes against every good programming practice I have ever been taught.

I am very disappointed. I demand asp.net shopping cart controls with standard views, access to gridview controls, auto database update functionality so you can parse any list of items for the store in xml or any database file or a spreadsheet and have it auto format the things so its easy to use. But no, they don't have that. I got my hopes up for nothing.

gah

No comments:

Post a Comment