in

 

Bytes of Wisdom

August 2007 - Posts

  • Things I hate...

    BTW, sorry I've been out of the loop for a while.  Whatever.

    Things I hate...Windows Vista.  Just kidding (well, not really).  Anyway, I hate Web Services that do little more than allow inefficient remote access to a databases. 

    As you may know, I'm working on a new contract these days for boring details see my blog on the matter.  In any case, I was excited to see the 3rd party vender's published web services that at first glance offered a nice interface to a complex system.  They developed a proxy library that's easy to use, offered an extensive domain library and supports asynchronous communications.  I was stoked and thought that this gig would be a breeze after all.

    Then reality set in...no support for batch operations.  Okay, I can deal with that.  The service API had a 1-for-1 relationship between classes and services, alright, I'm still here.  Then I found that no objects in the domain library have references to other objects.  If object A has a B logically, A will only expose the ID of B.  So let's say I have an house that must have an owner of type person.  A person has an address and a phone number, both required.  With the service interface, I'd have to add a phone number through the phone number service and an address through the address service.  I would get IDs back from both add operations and would have to use those IDs to add a person to the system.  Then I would get the person ID back and use it on the house's owner ID to add a new house.  The system's class hierarchy is much more complex and to say the least and using the web service started to seem silly.

    Whatever happen to "chunky" service interfaces?  If I used the web services, I would be replacing OLEDB with Web Services...dirty.  The argument from the architect was that the granular service API was needed to help performance.

  • Quick Background on my current CICS integration project

    I'm currently working on a stop-gap legacy integration project that is geared toward data integration between a legacy CICS system and a new 3rd party product.  I have 2 major tasks in this project, the first being a web application for bulk data entry into both systems simultaneously and the second being cross-system data transformation and transfer.  The integration points between the two systems are expected to support operations for the next 12 months.  Past integration projects have been handled through cron'd UNIX scripts, PL/SQL stored procedures, triggers, CICS batch jobs, etc.  Past projects also have left a dearth of documentation in their paths.

    The current integration approach to the CICS system is pre-defined, so I just have to work with "what is" in that regard.  I've had the joy of reading COBOL ctl files to complete requirements and design docs.  Integration involves FTPing flat files to and fro.

    The 3rd party product has a service-based API, but service calls are not chunky at all; so interfacing through that is a bit too wordy for the batch processing that I'll need to be doing.  To make things more fun, I have no ER diagrams for the new system's DB (which has a couple hundred tables), many entity relationships are not supported by foreign keys, no one seems to know what sequences are used to generate keys, the 3rd party system's source is closed and lacks technical documentation, I have no customer contact (from XP PoV, I only have a manager and a developer to interface with), my wife left me, and my dog died (okay, maybe not the last two).

    In any case, this is proving to be a delightful challenge (ah yes, and I failed to mention that the client wants betas for 5 batch interfaces and a the web application written in 3 weeks).  The client wants the solution written in VB.Net and has asked that some "best practices" be introduced into the organization along the way.  I've been constructing a domain model(s) that can speak between the two systems and believe that I'm making good headway in understanding the business better.

    I'll be blogging (maybe?) on some of my approaches as I work though this project.  I've done a fair bit of VB6 in the past (distant past), but the VB.Net syntax has felt strange having done so much C# over the last few years (at least now I can relate better to the VB.Net guys' questions at the local UG meetings).  Generics, attributes and reflection look especially weird.

    As far as tools, I'll be using some of the usual suspects, but will probably emphasize my use of NHibernate.  I've also had my first experience with using LDAP with forms authentication (if anyone wants an example I can do that too).  In fact, if there's anything about this project that may be of interest to you, drop a comment and let me know.

  • VB.Net oddity of the day - Assignment/Comparison operator

    On my current project I'm forced to code in VB.Net.  Normally I'm pretty open to other languages, but VB.Net is irritating (more so than VB6 in my opinion).  The language syntax is riddled with ambiguity (at least for a c-type guy like myself) and moving from c# to VB can be confusing.

    Here's my latest beef with VB.Net.  There's only one operator for assignment and comparisons.  As a result, the compiler handles evaluation of the the language syntax in a subtle, but irritating way.

    Here's some code to illustrate my point, I had something like this in my program:

    Dim oldValue, currentValue As Integer

    oldValue = currentValue = 2

    In C# this is cut and dry.  The value 2 would be assigned to currentValue and the side effect would be the value assigned, or 2.  I've long been in the habit of using assignment side effects in C#, but VB looks at this differently.  In VB, the value 2 is assigned to currentValue, but the side effect is the comparison of the two values.  In this case, currentValue initializes to 0, so the expression evaluates to false (or 0).  Therefore, oldValue now equals 0.

    Now, if I did this:

    Dim oldValue, currentValue As Integer

    currentValue = 2

    oldValue = currentValue = 2

    When the statement is evaluated, it will first evaluate the expression currentValue = 2.  2 will be assigned to currentValue and the side effect will be the comparison of currentValue to the assigned value, 2.  They are equal, so true will be returned and converted from bool to int as the non-zero value -1.

    It's no biggy, just annoying.

  • CLOBbered again!

    Hey all,

    I'm currently working on an NHibernate on Oracle project and ran into the first problem with CLOBs that I've had in some time.  I was trying to use a property that mapped to a CLOB in a Example instance for a session Criteria object.  No dice.  Oracle complained saying this:

    System.Data.OracleClient.OracleException: ORA-00932: inconsistent datatypes: expected - got CLOB

    Well, I guess sometimes you get lucky...and sometimes you just get CLOBbered.

    Guess now I have to dig into the NHibernate code if I have time.  All other CRUD works nice with Clobs, just Example chokes.  Could just be a dialect thing. 

    Cheers!

Copyright Los Techies 2007. All rights reserved.
Powered by Community Server (Commercial Edition), by Telligent Systems