How To Code in pure object oriented fashion in VB.NET

G

GMButler

When coding in any language in a pure object oriented
fashion, it is imperative that the language support
polymorphism, inheritance and encapsulation. How does
one completely encapsulate the data and behavior of a
VB.NET object such that the methods and properties are
executed or set by trapping messages that are sent as the
result of an event. No object should be directly
referenced from any other object (in other words, no
property of Object1 should be set from within Object2 or
no method of Object1 should be called from within
Object2). If I want to correct any object's bad behavior
(bug), I need only examine that object and no other. If I
want a property set for an object based upon some event
happening, I need only go to that object to discover what
messages(Collaborators in CRC parlance) it traps and the
methods it executes when that message is trapped. So, how
is this accomplished in VB.NET?
 
J

Jay B. Harlow [MVP - Outlook]

GMButler,
All I can say is WOW! ;-)

"No object should be directly referenced from any other object"

Is going to be a tall order to fill. ;-) Considering objects calling methods
on other objects is the 'message passing' paradigm used in the .NET world.

You probably want to start with the documentation:

Visual Basic and Visual C#:
http://msdn.microsoft.com/library/d...con/html/vboriManagedDevelopmentStartPage.asp

Visual Basic Language
http://msdn.microsoft.com/library/d...y/en-us/vbcn7/html/vaconProgrammingWithVB.asp

Visual Basic >NET Language Specification:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbls7/html/vbSpecStart.asp


Hope this helps
Jay
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top