views:

236

answers:

4

hi guys, i'm currently in the process of modifying a legacy editor application and i need to add in a few data structures which i have made into a class of it's own which i later add to a collection object. but thus far i'm little bit blurry on where to put all of my functions which is related to that object. i'm thinking maybe OO like design, but i'm not quite sure how to do this in vb6. else all the functions are currently in a module mdl file. which are set as public function.

is there any good reference, book or whatever which i can learn more about how to properly design for vb6 app? for the current work and for future work i guess.

thanks.

+4  A: 

Are you familiar with Rocky Lhotka's work? I would recommend reading Visual Basic 6 Business Objects.

Visual Basic 6 Business Objects provides a thorough introduction to employing objects that are used to model real-world business problems.

You can also visit www.lhotka.net

Edit :

I know it sounds like a lot of trouble, but I would really recommend you take the time and read Rocky's book. He talks about simulating OOP principles eg. like simulating inheritance in vb6 ect.

MegaByte
@Shaun, hehe, not really but thanks, i'll look into it.:)
melaos
+2  A: 

Another good source of information is Deborah Kurata, she's written a series of books about OO coding in VB. Less well known than Rocky Lhotka (who is excellent), and concentrates more on pure OO, not the ORM/DB layer that he does.

MrTelly
+2  A: 

All the reference cited so far are good. However the Design Patterns by the Gang Of Four is usable for Visual Basic 6. The trick to remember that most of the pattern talked about in Design Patterns rely on implementing interfaces which VB6 can do well. In fact you will find most design patterns involve implementing interfaces.

This is because most design patterns focus on setting up how various objects interact as opposed to reusing behavior. So interface become much more important.

Design Patterns by the GoF Patterns by Martin Fowler The various GUI and presentation patterns is the most applicable in my opinion.

My own application is structured completely as a series of design patterns. For example I use a Passive View for my presentation layer. The various views called command objects which does the actual modifications of the model. I use factories to retrieve the list of reports, file types, and shapes my software support. All done in VB6 using the Design Patterns book by the GoF.

RS Conley
+1. Can I also plug the book "Visual Basic Developer's Guide to UML and Design Patterns" by Griver etc? Explains design patterns in 100% VB6, discussing issues like circular references. Anyone whose main experience is in VB6 might find the gang of four book difficult, I recommend this fine book instead. http://www.amazon.com/Visual-Basic-Developers-Design-Patterns/dp/0782126928
MarkJ
+1  A: 

Before getting deep into the theological aspects of OOP those books cover you might begin by simply reading the VB6 documentation. In particular the sections on component design.

Bob
+1. And it's online of course. You could start here. http://msdn.microsoft.com/en-us/library/aa262304(VS.60).aspx
MarkJ