Hello and welcome to CertForums.co.uk, here we host free active certification forums with links to the best free resources for Microsoft's MCSA MCSE MCDBA Cisco's CCNA CCDA and CCNP, and CompTIA's A+ Network+ i-NET+ and Security+ certifications in the UK. If you wish to post or use other advanced features you will need to register first. Registration is absolutely free and takes only a few minutes to complete so sign up today!

If you have any problems with the registration process or your account login, please contact support

Go Back   CertForums > Computing Support Forums > Programming & Scripting
Home Forums Register Search Today's Posts Mark Forums Read

Collections in VB.Net

Post New ThreadReply
 
Thread Tools Display Modes
  #1  
Old 03-Apr-2008, 03:54 PM
Fergal1982's Avatar
Fergal1982 Fergal1982 is offline CertForums News Posting Member
Their's not to reason why
Posts: 3,028
Points: 4638 Fergal1982 has over 4000 pointsFergal1982 has over 4000 pointsFergal1982 has over 4000 pointsFergal1982 has over 4000 pointsFergal1982 has over 4000 pointsFergal1982 has over 4000 pointsFergal1982 has over 4000 pointsFergal1982 has over 4000 pointsFergal1982 has over 4000 pointsFergal1982 has over 4000 pointsFergal1982 has over 4000 points
Power: 85
None
Join Date: 04 May 2004
Location: Aberdeen, UK
Age: 25
Certifications: ITIL Foundation
WIP: 70-536,70-294,(A+), Procastination+
Wink Collections in VB.Net

I'm getting a little confused by how to implement collections within vb.net.

Basically I have two classes: Parent; and Child.

The Parent class can have one or more Child objects associated with it. I want to add a method to the Parent class that returns a collection of the Children associated with it.

But, as I understand it, I need to implement a collections class for the Child object. Problem is, the details I've found online just seem really confusing to me. I've tried creating a class and implementing the Icollection, but i just dont understand how I need to put it together.

Does anyone have any good links for learning this?


"Im Nerdy in the extreme and whiter than sour cream"


ObsidianPhoenix - my development blog



 
Reply With Quote
  #2  
Old 03-Apr-2008, 05:00 PM
dmarsh dmarsh is offline
Lifetime Member
Posts: 1,197
Points: 2781 dmarsh has over 2500 pointsdmarsh has over 2500 pointsdmarsh has over 2500 pointsdmarsh has over 2500 pointsdmarsh has over 2500 pointsdmarsh has over 2500 pointsdmarsh has over 2500 pointsdmarsh has over 2500 pointsdmarsh has over 2500 pointsdmarsh has over 2500 pointsdmarsh has over 2500 points
Power: 41
None
Join Date: 24 May 2007
Location: Hampshire
Age: 34
Certifications: One or two...
WIP: OU MST121
Try reading these :-

http://www.atomicobject.com/pages/Aggregation
http://en.wikipedia.org/wiki/Object_...on#Aggregation

http://msdn2.microsoft.com/en-us/library/395dc977.aspx

Theres no need to implement a collection interface unless you want to create your own collection class, or data structure, for simple aggregation this is not required, just use the languages array or collection contructs or classes.

If you mean parent and child in the literal real world sense then you probably want to model things using other OO constructs, for example a Parent and a Child are both Persons indicating inheritence. You then probably want containment by reference as some peoples parents may be other peoples children. Of course you should create inheritance heirachies based on functionality, so if there is none, in reality you would probably just model it with a single Person class.

http://en.wikipedia.org/wiki/Inherit...mputer_science)

Martin Fowlers Analysis Patterns is an excellent introduction into such things. However patterns information is everywhere these days so buying the book is not necessary if you are prepared to dig a bit.

http://martinfowler.com/apsupp/accountability.pdf



Last edited by dmarsh : 03-Apr-2008 at 05:30 PM.
 
Reply With Quote
  #3  
Old 04-Apr-2008, 08:55 AM
Fergal1982's Avatar
Fergal1982 Fergal1982 is offline CertForums News Posting Member
Their's not to reason why
Posts: 3,028
Points: 4638 Fergal1982 has over 4000 pointsFergal1982 has over 4000 pointsFergal1982 has over 4000 pointsFergal1982 has over 4000 pointsFergal1982 has over 4000 pointsFergal1982 has over 4000 pointsFergal1982 has over 4000 pointsFergal1982 has over 4000 pointsFergal1982 has over 4000 pointsFergal1982 has over 4000 pointsFergal1982 has over 4000 points
Power: 85
None
Join Date: 04 May 2004
Location: Aberdeen, UK
Age: 25
Certifications: ITIL Foundation
WIP: 70-536,70-294,(A+), Procastination+
Cheers mate, they arent actually parent/child in the literal sense, just in the sense that the parent object has multiple children objects.


"Im Nerdy in the extreme and whiter than sour cream"


ObsidianPhoenix - my development blog



 
Reply With Quote
Post New ThreadReply Spread this thread: Submit this thread to digg Submit this thread to del.icio.us


Go Back   CertForums > Computing Support Forums > Programming & Scripting


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
VB.Net Finding open forms, and allowing only a single instance of each Fergal1982 Programming & Scripting 10 26-Aug-2008 07:49 AM
RICHTEXTBOX VB.NET FORMAT PROBLEM timark Programming & Scripting 6 10-Dec-2007 02:25 PM
C# or VB.net Lozmo9 MCAD /MCSD / MCTS / MCPD 2 27-Oct-2007 01:55 PM
VB.Net RichTextBox Formatting Fergal1982 Programming & Scripting 5 08-Oct-2007 01:36 PM
Learning VB.NET wideboy_west Programming & Scripting 4 01-Dec-2006 10:54 AM


All times are GMT. The time now is 10:01 PM.

Powered by vBulletin® Version 3.6.11
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
CertForums.co.uk (C) copyright 2003-2007 All Rights Reserved. Content published on CertForums.co.uk requires permission for reprint.
Hosted by Lunarpages