What is a good OOP way to handle this

I need create a text file sent to a check printer thru the DOS type command.
That part I have handled. My problem is that the check will have some static parts, check eader (mailingaddress) , multiple invoice headers(invoice number, date of invoice) and then mulitple lines for the details of the invoice.

I started with a check class, Then I tried a document collection of the check class to load the class with all the invoices for a check, but now I have to detail sections after getting farther into the code. Multiple invoices with multiple lines. It is like I need a check class, wrapped around an invoice classes with Inovice detail wrapped in the Invoice class.

Or should I just pitch OOP and just write straight code with a bunch of variables to maintain my location on the page and print line by line as I read from the datatable.

I'd like to go thru a for each row in datable pull all the info to be on a check and when I see the next check number I want to loop thru the check collection and print the check before loading it again. But the detail is what is messing me up. Can I do a collection of class withing a collection of class within a class?

Thanks,

[1208 byte] By [Papoots] at [2007-12-24]
# 1

"Or should I just pitch OOP and just write straight code with a bunch of variables to maintain my location on the page and print line by line as I read from the datatable."

These aren't mutually exclusive. OOP is made to help you do things, not to trip you up.

Unfortunately you know far more about the requirements your task than I do. I do think there are two different questions. "What is the nature of what you need to do?" That's the primary question. After you have that really clarified, the next question is, how do I do that in OOP. Neither are here to make the other more difficult.

ReneeC at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic Language...