Campbell Ritchie wrote:I used to have one of them. It had three positions, •••. The white • was used for cutting stencils, without using the ribbon. I gave up buying black and red ribbons because I never seemed to use the red.
Tim Holloway wrote:. . . . Some typewriters even had a ribbon shift key. . . . .
Campbell Ritchie wrote:They had a paper bank statement sheet for each customer, which was taken out of the file and put into an adding machine, and all transactions were printed on it by the adding machine; negative figures caused it to use red ink. The sheets were duplicated and once a month one copy was posted to the customer as a statement. That is what my bank statements looked like for the first year I had the account; when I moved to a different branch, they used a basic computerised system.
Tim Holloway wrote:. . . in the real world, banks actually didn't update balances in real time. Instead, they posted transactions that were batched up and applied overnight. . . .
Noorul Hameed wrote:Physical is not a parallel, or even ATM/Online could be parallel.
Kaine van Gemert wrote:
Again, in JSF, the action method "payExpense()" can invoke whatever business logic it wants, knowing that all of the Model values have been vetted and updated before payExpense() has been called.
Say one of the model values is the persons balance, if you just update this based on the user input, before calling the business logic, it would update the balance to be the balance - the expense. Isn't it the business logic that determines whether or not the transaction can succeed? It would check the user has sufficient funds, or if it's in another currency for example then maybe some currency exchange might need to happen etc.
Kaine van Gemert wrote:You mention you name all properties 'setXxx()', I get what you mean, but how does this apply to lists or maps? I see how that makes sense for most properties but as soon as it is a collection or map of some sort the 'setXxx()' would logically mean set the entire collection/amp, how would you modify this approach to work within collections/maps?
Campbell Ritchie wrote:I was thinking to make only the getXXX methods public and other mutating methods, e.g. in this case addMoney(...) or payExpense(...), to be restricted to the package containing the model.
There may be another way to do that with packages exported and not exported, but I have no experience with that new feature.
Campbell Ritchie wrote:I was thinking of fields being private, as they always should be, and some methods being restricted to package‑private access.
Tim Holloway wrote:. . . reason not to use package-scope for properties is because it's hard to read and maintain code where someone can come in more or less unexpectedly and meddle with your toys. . . . .
We disabled the edit button a long time ago because we had problems with people editing code after it had been replied about.
Kaine van Gemert wrote:I can't find an edit button so I'm just going to post here.
I was just wondering are package-private methods/members considered bad practice? I only ask as I haven't really come across them when reading other code.