[dba-VB] Fail Fast

Shamil Salakhetdinov shamil at smsconsulting.spb.ru
Wed May 21 16:48:22 CDT 2008


Hi Charlotte,

Thank you for sharing your experience on the subject.

--
Shamil

-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust
Sent: Tuesday, May 20, 2008 11:33 PM
To: Discussion concerning Visual Basic and related programming issues.
Subject: Re: [dba-VB] Fail Fast

Shamil,

We use a similar approach in our data tier entities.  We implement
business rules in the entity to handle validations on events like
RowChanging and ColumnChanging and throw exceptions, some standard and
some that we've defined in our own Exceptions project.  The exception
message gets attached to the column(s) containing errors and the whole
thing is handed back to the calling routine for handling.  That way, the
error is triggered whether we create or modify a record from the UI or
in code, and the UI can use the returned exception columnerror
information to present messages to the user, roll back the edit, or
whatever.  We also use it to keep users from exiting a form in the
middle of a record without either discarding or committing it.

Charlotte Foust 

-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil
Salakhetdinov
Sent: Tuesday, May 20, 2008 12:17 PM
To: 'Access-D - VB'
Subject: [dba-VB] Fail Fast

Hi All,

Would you like to minimize lengthy debugging sessions - then use "Fail
Fast"
approach!:

http://www.martinfowler.com/ieeeSoftware/failFast.pdf 


It sounds very tempting I must say, and the author's arguments are good
and practical, but you can find that proposed approach is rather
different from On Error Resume ... or On Error GoTo ... used in almost
all and every function/sub/property approach recommended as professional
programming style in VBA/VB6...

To catch up inevitable bugs and gracefully present them to the users
author recommends using global error handlers...
 
Do you feel any flavors with the proposed approach? Please share them
here.

I do not (I could have missed some), and I do plan to adapt to this
approach: I used like that in C ages ago but VB6/VBA programming made me
a bit "paranoid" and I did widely use On Error... VB6/VBa
construction...

In my understanding proposed subject approach results in streamlined
coding with less code lines, less comment lone as well as less time
spent in long debugging sessions: of course "there is no free cheese in
this world" and proposed approach implies using Test Driven Development
but anyway overall result is positive with (significant) development and
support time savings as author states (based on his broad development
experience) in this subject article and in his excellent book "The Art
of Agile Development" he coauthored with Shane Warden...

Thank you.

--
Shamil

_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com


_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com




More information about the dba-VB mailing list