Certainly not with only 5 lines.Īnd another huge advantage of this approach is that the new business rule is implemented only at a single place, if you’re doing it right: In a database view that you can join to all the other tables that need access to transactions / balances. It has constraints, indexes, and all sorts of other meta data to optimise this query in a way that you probably wouldn’t have achieved in pure Java code. It has many many bits of information that help it calculate the above extremely fast, with no additional cost – all in memory. The truth is, your database is actually the best place to do such calculations. But then, beware that you’re following 10-20 year-old “legacy” principles by not using SQL (see also Fallacy #1). Who said that? Some guy from the 90s who had written a book on Object-Oriented Design Patterns? Of course, if you blindly follow random architecture rules, this may apply to you. Now this is really the biggest of all fallacies. Fallacy #5: The database is the wrong place for business logic
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |