Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 2008 > Visual Basic 2008 Essentials
|
Visual Basic 2008 Essentials If you are new to Visual Basic programming with version 2008, this is the place to start your questions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2008 Essentials section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 2nd, 2009, 04:19 AM
Registered User
 
Join Date: Mar 2009
Posts: 5
Thanks: 2
Thanked 0 Times in 0 Posts
Default Complex (to me) Object Questions

Here's the basics:
We make machines, so here's what we have:
1. Stuff we sell - Sales Order class - lots of Sales Order objects. (Do I use Collections, like in the old days, or Dictionaries?)
2. Stuff we buy - Purchase Order class - lots of Purchase Order objects...
3. Stuff we build - Work Order class - lots of Work Orders...

I would like to have one utility to print data from all 3 classes. Is this the proper use for Secondary Interfaces? Can I write one printing method and use it to print data from each class? If so, how do I do it? If not, what's the best way to write one method to print all three objects?
 
Old March 2nd, 2009, 07:18 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Hello.. You want to print this data in which way?? using a report component (like crystal reports)? or to a text file, or something else??

Also, you don't have collections now ;) you have structures that inherits from collections.
__________________
HTH

Gonzalo


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the
proof.
================================================== =========
 
Old March 2nd, 2009, 01:57 PM
Registered User
 
Join Date: Mar 2009
Posts: 5
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Gonzalo,
Thank you for getting back to me so quickly.
For the various Orders objects, I want to use a quick text printing routine. The print is mostly for me.
No collections in VB2008? How are they handled now?
 
Old March 2nd, 2009, 05:11 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Then you should override the to text property (or make yourself one) that returns the data you want formated like a string. Then you can write a procedure that get all the data from every "collection".
You could write and interface, or inherits all this classes from a print class, but somewhere you will have to say how to print the data.

And for the collections, you have collections, but they are specialized (sortedlist, hashmap, dictionary, and others).
__________________
HTH

Gonzalo


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the
proof.
================================================== =========
The Following User Says Thank You to gbianchi For This Useful Post:
TComfort (March 3rd, 2009)





Similar Threads
Thread Thread Starter Forum Replies Last Post
.NET bug: Error reflecting complex object with Nul peterwood .NET Web Services 0 February 7th, 2008 11:35 AM
Designing Custom Membership Object Questions... spar108r C# 0 February 10th, 2007 02:48 PM
Simple or Complex richb XML 8 December 12th, 2006 01:40 PM
Some questions about the object iloying JSP Basics 1 April 8th, 2006 04:20 AM
object builder questions netstudy C# 2005 0 March 13th, 2006 11:55 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.