Design question

Design question

Old forum URL: forums.lhotka.net/forums/t/3015.aspx


albruan posted on Sunday, June 10, 2007

I'm in the design stage of a project at work for tracking and retrieving overpayments made on medical insurance claims.  There are basically two ways in which possible overpayments enter the system; one is that they'll be keyed in via the UI by customer service reps and the other is that they'll be sent as an Excel worksheet dropped into a specific folder which our Windows Service will pick up and process.  So, I'll have two objects: an Overpayment object used in the first case, and an OverpaymentBatch object, which will contain Overpayment objects and will be used by the service to handle Excel worksheet submittals.  At least that was my thinking, but there's a problem with it. 

Let's say they want to come back and look at the status of Overpayment #1001, so they key in 1001 which gets passed into the criteria for the Fetch method as an integer and the info for that Overpayment is returned.  So far, so good.  Now, let's say they then want to check the status of all Overpayments made via OverpaymentBatch #100, so they key in 100 which gets passed into the criteria for the Fetch method on OverpaymentBatch as an integer and the high-level info for that OverpaymentBatch object is retrieved.  It's at this point that the whole thing falls apart because, in order to return all the Overpayment child objects of this particular OverpaymentBatch object, I'd have to pass the batch ID in as the criteria for performing the Fetch on the Overpayment objects.  Suddenly, the Fetch method on the Overpayment object doesn't know if it's to return an item based on its Overpayment ID or its OverpaymentBatch ID.

I thought maybe I could pass in the value for an Overpayment ID as an integer and pass in the value for an OverpaymentBatch ID as a string and then cast it to an integer once it's inside the Fetch method for the Overpayment object, or vice versa.  But I feel that's probably unneccesarily jumping through hoops to accomplish a relatively easy task.   

Is there another way that I'm simply not seeing?

dshafer replied on Monday, June 11, 2007

Albruan,

Why don't you create a separate criteria class, fetch method, and get method for fetching by batchId.  This way the system would know which criteria you were using based on which criteria class you are passing in.

Dustin

albruan replied on Monday, June 11, 2007

Thanks, Dustin.  I hadn't thought of that...my brain is going kinda numb after putting in 70 hrs last week and 76 hrs the week before that.  Thank heavens I'm not on salary as are the two other guys on this project; on the other hand, I'd rather have fewer hours rather than a bigger paycheck.

Copyright (c) Marimer LLC