Wrox Home  
Search P2P Archive for: Go

  Return to Index  

expert_vb_business_objects thread: RE: VB6 BrokenRules Class for VB.NET


Message #1 by "Rockford Lhotka" <rocky@l...> on Thu, 20 Feb 2003 15:54:22 -0600
1) No. Inheritance defines an 'is-a' relationship. Your business object
is _not_ a broken rule or a collection of broken rules, so it shouldn't
inherit from BrokenRules. Your business object 'has-a' BrokenRules
collection, so this should be implemented as a containment relationship.
This means that your business object should have a class-level instance
variable that refers to its list of broken rules.
 
2) Any collection can work. In the book I create a custom collection
based on CollectionBase. Actually its a bit more complex than that - it
inherits from a base class I created that enhances data binding support.
The end result is that the collection can be returned to the UI, where
it acts as a read-only bindable collection so the UI developer can
display a list of the broken rules by binding the collection to a
ListBox or other list control.
 
3) I'm afraid that in the book my translation of BrokenRules from VB6 to
VB.NET isn't so direct that line-by-line questions make sense. However,
no where do I use On Error statements - everything is handled through
Try blocks.
 
4) There are many ways to implement the BrokenRules concept. You can
definately implement the same VB6-style behavior in VB.NET, and it
sounds like that is your current approach. There's nothing wrong with
that. With the book I took the opportunity to improve on the design a
bit and to incorporate the idea of exposing the list of broken rules to
the UI - something many readers have done over the years as an
enhancement to the VB6 code.
 
Hopefully this helps, thanks,
 
Rocky
 
Rockford Lhotka
Author of 'Expert One-on-One VB.NET Business Objects' (Wrox Press)
rocky@l...    http://www.lhotka.net <http://www.lhotka.net/>  

-----Original Message-----
From: Ralph Loizzo [mailto:ralph@a...] 
Sent: Thursday, February 20, 2003 10:02 AM
To: rocky@l...
Subject: VB6 BrokenRules Class for VB.NET


First off, Ive ordered your new VBNET Business Objects book from Amazon,
but that's not due to come out till March.  Can you help with this now?
 
If so great!  
 
4 questions concerning the BrokenRules Class
 
1)    Should my .NET business objects inherit from Broken Rules?  (are
they child objects?)
 
2)    What type of .NET collection would be best used by BrokenRules
 
3)    The line "On error goto handleerror", should that be just a TRY
block with no CATCH or FINALLY clause?
 
4)    Any other .NET issues I should be aware of with the VB6
BrokenRules class?
 
 
I understand the concepts of the BrokenRules class, Im just wondering
how you incorporated its functions into the .NET framework.
 
Ralph Loizzo
 
ralph@a...
 
 



  Return to Index