How do you set up your classes, and your file structures?
Below is a 1 sheet “handout“ that I'm preparing for my talk on Saturday.
It's really more of a handful of thoughts about how I want to do things rather than a suggestion.
Tools and methods I want all my classes to have.
Given Class Foo (and instatiation of myFoo)
myFoo.SaveSelfToDisk(“filepath.format”)
myFoo.LoadSelfFromDisk(“filepath.format)
Foo newFoo = myFoo.Clone()
Bool areEquals = (myFoo.IsEqualTo(newFoo)
An interface for Foo
A stub_Foo class that implements the IFoo interface
The stub should give ExceptionNotImplemented errors on methods not used.
The stub should be able to throw any exception that Foo can throw
Unit Tests for Class Foo
A factory somewhere that generates an IFoo object
Which bring us to architecture, should it be ( A )
Solution
Foo
Foo.vb
IFoo.vb
Stub_Foo.vb
UnitTests
UnitTests_Foo.vb
Or Should it be ( B )
Solution
Foo
Foo.vb
Interfaces
IFoo.vb
Stubs
Stub_Foo.vb
UnitTests
UnitTests_Foo.vb
I think I would look at B as a direction to go to, but that A would be a more expected start in a legacy app.