Marc,
While looking at your EndKlant() function I noticed that it contains user interface code:
- Code: Select all Expand view
if msgyesno("Gewijzigde gegevens bewaren")
...
endif
User interface code should not be inside any buisness object, so this should be moved to outside the function when it is changed to a method of the customer class. Here are a couple of reasons why.
1) Granularity--you want to strive for small pieces of code that have a single purpose.
2) Automation-- For instance, if you wanted to update all the records with new data, you need to be able to call the Save() method once per record. Thus you cannot have user interface code popping up for each record.
Business objects and human interface objects should be totally separate. You can, of course, have an edit-business-object class, for instance EditCustomer. You then can then pass a customer object to that class for editing.
- Code: Select all Expand view
oCustomer:=TCustomer():New(cCustNo)
oEditCustomer:=TEditCustomer():New()
oEditCustomer:edit(oCustomer)
Simple.
James