[openbeos-midi] Re: BMidiPort is finished

  • From: "Matthijs Hollemans" <matthijs@xxxxxxxxxxxxxxxxxxx>
  • To: <openbeos-midi@xxxxxxxxxxxxx>
  • Date: Sat, 16 Nov 2002 10:49:43 +0100

Hi Jerome,

> Yes I know need testing and debugging (I hope not a lot)
> That class is fully compatible with the header from Be.

You have been very busy I see ;-) Good!

Two remarks:

1) Testing. You say the class still needs testing and debugging.
That means it is _not_ finished. What I would like you to do -- and
this is how all the other OpenBeOS teams do it -- is write "unit
tests" for the classes. These tests go into the src/tests/kits/midi/
directory. If you are unsure about what unit tests exactly are,
please look through some of the older OpenBeOS newsletters.

These tests are very important, and I want all of our classes to
have corresponding tests! What sort of things should you test?
Anything that can go wrong. Also test if your implementation of
BMidiPort exactly does what Be's BMidiPort did, and what the BeBook
says it should do.

2) Thread-safety. Is your implementation of BMidiPort thread-safe? I
want you to think about what possible problems might occur if two
threads use the same BMidiPort class at the same time. And how did
you/will you solve these problems? Is Be's BMidiPort thread-safe?
What does the BeBook say about this? And so on...

> 3 private functions(Dispatch(...), Read(...), Write(...)) and 2
> data (=5Fm=5Fprev=5Fcmd, =5Fm=5Fenhanced) are not used.

You can throw away the functions that you don't use (as long as they
are private and not virtual). You can also throw away the private
data you don't use, but you have to add a little to the reserved[]
array to keep the size of the class the same. I suggest you do that
because having things around that are not used will be confusing.

> Matthijs I don't use "your" naming variable style sorry but if
> you want to change there name you can do it freely.

For now I don't care. When we reach beta status, I will probably
want to clean up the source code so that it has one style.

One remark though: I saw that you removed all of the code for
MidiPort that I wrote and replaced it with your own. That is not
very smart. I spent a lot of time fixing up these source files and
making sure they are binary compatible. If you simply throw that
away, then I did all of that work for nothing, and more importantly:
I will have to do it all over again. Next time, could you please add
your code to the existing source code and not throw anything away?

> Matthijs I will send you privately an image (as soon I draw it)
> who explain how work BMidiPort.

Cool! I like images ;-)

> Next mission writing BMidiStore ok

Like I said above, I would like you to really really finish
BMidiPort first. Otherwise, we might end up with a bunch of classes
that are almost finished, but not quite. And then we still have to
do all of that work (writing tests, worrying about threads)

Anyway, keep up the good work!

Other related posts: