Jan Kucera said:
But if the data model changes, I have to change the data layer as well as
the business layer, haven't I?
Not necessarially. It's actually quite rare (and not a good idea) to change
the database's interface (names of stored procs., table design, etc.). But
it is quite common to change databases entirely. So, if the "old" database
was, say, Oracle and the new one is SQL Server, your data layer would need
to be re-written for different data access, but the SP names as well as
input/output parameters don't neccessarially change. None of this need
affect the business layer at all.
Which layers do you have, or what do you recommend to put in the
individual layers?
It's pretty common to have (at least) a UI layer, a business layer and a
data layer.
UI layer - responsible for all aspects of the user's interface with the
application. This would be the web pages of a web based application or the
form or console of a client application. User input is validated here and
results and errors are formatted and presented here.
Business layer - business rules are processed here (i.e. functions that
BEGIN the process of getting, modifying and creating customer or vendor
data).
Data layer - usually called by the business layer methods. This layer
receives business layer data, connects to the data store and sends results
back to the business layer.