Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Design

Status
Not open for further replies.

Grimwaldi

Programmer
Nov 1, 2002
58
GB
Should I design the architecture of my conversion, which I am writing from scratch, for the screen to hold no code, but to call a business object, which does the work. Or to stick to the 'old' method of using memory variables and having code 'embeded' in the form(s)?

I don't plan to use SQL server or any other server as I think that it is not really needed, so no 3-tier work.
 
It depends...

If you'll be rarely updating the code and the app
is a one-off app, then I'd elect to embed the code
in the UI.

On the other hand, if you'll be updating frequently and
you are creating objects for re-use across many
similiarly patterned apps, go with no code in the UI.

Building n-tier takes a fair amount of work up-front, but
the pay-off comes with time.

I've been able to up-date apps in 3 minutes because of separating the UI from the business logic.

Darrell

'We all must do the hard bits so when we get bit we know where to bite' :)
 
Does that go for navigation as well?, wouldn't a skip be enough. And will this method slow the app down?
 
Grimwaldi

Two rule-of-thumb I've applied over the years :

1."Design the application as if there wasn't any interface (specially if you are designing for a client that may change the interface on a whim). Create your business rules in custom classes that can be called from anywhere within the application. Once that is finished then work on the forms, at least you know your forms aren't dependent on the business and vice-versa."

2. When it comes to the U.I. "If it directly affect how the form behaves, put it in the form, otherwise put it in a separate custom class."

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Grimwaldi

Does that go for navigation as well?, wouldn't a skip be enough. And will this method slow the app down?

If you apply the logic I suggested, it would fall under "Does this affect the behavior of the form?" Yes it does (when you hit the next button, the record changes). So it should go in the form. Although to make this more OOP like, you could create a custom class that handles all the navigation of your app, just pass the ALIAS() as a parameter.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top