tag:blogger.com,1999:blog-426922399870577072.post1654185092318007972..comments2024-03-28T08:13:24.785-04:00Comments on The Database Programmer: Database Triggers, Encapsulation and CompositionKenDownshttp://www.blogger.com/profile/11117175783163937575noreply@blogger.comBlogger25125tag:blogger.com,1999:blog-426922399870577072.post-46657568225044209412020-05-20T14:05:50.494-04:002020-05-20T14:05:50.494-04:00I enjoyed your blog Thanks for sharing such an inf... I enjoyed your blog Thanks for sharing such an informative post. We are also providing the best services click on below links to visit our website.<br /><br /><a href="https://groarz.com/Digital-marketing" rel="nofollow">digital marketing company in nagercoil</a><br /><a href="https://groarz.com/Digital-marketing" rel="nofollow">digital marketing services in nagercoil</a><br /><a href="https://groarz.com/Digital-marketing" rel="nofollow">digital marketing agency in nagercoil</a><br /><a href="https://groarz.com/Digital-marketing" rel="nofollow">best marketing services in nagercoil</a><br /><a href="https://groarz.com/Digital-marketing" rel="nofollow">SEO company in nagercoil</a><br /><a href="https://groarz.com/Digital-marketing" rel="nofollow">SEO services in nagercoil</a><br /><a href="https://groarz.com/Digital-marketing" rel="nofollow">social media marketing in nagercoil</a><br /><a href="https://groarz.com/Digital-marketing" rel="nofollow">social media company in nagercoil</a><br /><a href="https://groarz.com/Digital-marketing" rel="nofollow">PPC services in nagercoil</a><br /><a href="https://groarz.com/Digital-marketing" rel="nofollow">digital marketing company in velachery</a><br /><a href="https://groarz.com/Digital-marketing" rel="nofollow">digital marketing company in velachery</a><br /><a href="https://groarz.com/Digital-marketing" rel="nofollow">digital marketing services in velachery</a><br /><a href="https://groarz.com/Digital-marketing" rel="nofollow">digital marketing agency in velachery</a><br /><a href="https://groarz.com/Digital-marketing" rel="nofollow">SEO company in velachery</a><br /><a href="https://groarz.com/Digital-marketing" rel="nofollow">SEO services in velachery</a><br /><a href="https://groarz.com/Digital-marketing" rel="nofollow">social media marketing in velachery</a><br /><a href="https://groarz.com/Digital-marketing" rel="nofollow">social media company in velachery</a><br /><a href="https://groarz.com/Digital-marketing" rel="nofollow">PPC services in velachery</a><br /><a href="https://groarz.com/Digital-marketing" rel="nofollow">online advertisement services in velachery</a><br /><a href="https://groarz.com/Digital-marketing" rel="nofollow">online advertisement services in nagercoil</a><br /><br /><a href="https://groarz.com/Web-Design" rel="nofollow">web design company in nagercoil</a><br /><a href="https://groarz.com/Web-Design" rel="nofollow">web development company in nagercoil</a><br /><a href="https://groarz.com/Web-Design" rel="nofollow">website design company in nagercoil</a><br /><a href="https://groarz.com/Web-Design" rel="nofollow">website development company in nagercoil</a><br /><a href="https://groarz.com/Web-Design" rel="nofollow">web designing company in nagercoil</a><br /><a href="https://groarz.com/Web-Design" rel="nofollow">website designing company in nagercoil</a><br /><a href="https://groarz.com/Web-Design" rel="nofollow">best web design company in nagercoil</a><br /><a href="https://groarz.com/Web-Design" rel="nofollow">web design company in velachery</a><br /><a href="https://groarz.com/Web-Design" rel="nofollow">web development company in velachery</a><br /><a href="https://groarz.com/Web-Design" rel="nofollow">website design company in velachery</a><br /><a href="https://groarz.com/Web-Design" rel="nofollow">website development company in velachery</a><br /><a href="https://groarz.com/Web-Design" rel="nofollow">web designing company in velachery</a><br /><a href="https://groarz.com/Web-Design" rel="nofollow">website designing company in velachery</a><br /><a href="https://groarz.com/Web-Design" rel="nofollow">best web design company in velachery</a><br /><br />Thanks for Sharing - ( Groarz branding solutions )The Marketerhttps://www.blogger.com/profile/05201326265579013641noreply@blogger.comtag:blogger.com,1999:blog-426922399870577072.post-2419675217951106192019-12-28T01:04:45.189-05:002019-12-28T01:04:45.189-05:00Hulu is one of the best streaming services that ea...Hulu is one of the best streaming services that ease access to content on different types of devices. You can stream across computers, mobile devices and gaming consoles at <a href="https://plus-hulu.com/activate" rel="nofollow">www.hulu.com/activate</a>. However,before enjoying this service you will need to subscribe to the service and activate your Hulu account.<br />salonihttps://www.blogger.com/profile/04561118454795521079noreply@blogger.comtag:blogger.com,1999:blog-426922399870577072.post-41031744407495136082019-12-28T01:03:49.907-05:002019-12-28T01:03:49.907-05:00Norton is an antivirus and security software for W...Norton is an antivirus and security software for Windows, Mac, iPhone, and Android. Visit <a href="http://norton.com-setup.uk.net" rel="nofollow">www.norton.com/setup</a> as it has many different features for protecting the device from various web threats and the main features in the Norton software are anti-spyware, web browser protection, antivirus, and firewall security.<br />salonihttps://www.blogger.com/profile/04561118454795521079noreply@blogger.comtag:blogger.com,1999:blog-426922399870577072.post-69857229835291697222019-12-19T00:15:43.332-05:002019-12-19T00:15:43.332-05:00Download webroot install with key code Antiviurs I...Download <a href="https://webrootcom-safe.uk.net" rel="nofollow">webroot install with key code</a> Antiviurs If you own a device or system and you are connecting it to internet or another device then you must have antivirus software. Virus or any risky threat like Malware, Trojan, Spyware, Rootkit or online hacking or attack can steal your data and damage your system.Kajal Agarwalhttps://www.blogger.com/profile/03940712381864870198noreply@blogger.comtag:blogger.com,1999:blog-426922399870577072.post-49035288916566589032019-12-18T23:51:49.102-05:002019-12-18T23:51:49.102-05:00It is extremely important to protect your PCs, Mac...It is extremely important to protect your PCs, Mac, computers as well as mobile devices and tablets with <a href="https://avgcom-retail.uk.com" rel="nofollow">avg retail registration</a> . Kajal Agarwalhttps://www.blogger.com/profile/03940712381864870198noreply@blogger.comtag:blogger.com,1999:blog-426922399870577072.post-81721823011431890242019-12-18T23:45:24.058-05:002019-12-18T23:45:24.058-05:00To activate Hulu Plus on your device, either use t...To activate Hulu Plus on your device, either use the on-screen keyboard to enter your Hulu log in information or go to <a href="https://hulucom-activate.uk.com" rel="nofollow">hulu tv activate code</a> and enter the device activation code. Either of these methods will allow you to use Hulu on any Hulu-supported device.Kajal Agarwalhttps://www.blogger.com/profile/03940712381864870198noreply@blogger.comtag:blogger.com,1999:blog-426922399870577072.post-39526929866355727912019-12-18T23:43:44.925-05:002019-12-18T23:43:44.925-05:00Real-time problems and outages for Office 365. Is ...Real-time problems and outages for Office 365. Is the service down? Can't login or connect? Here you see what is going on. for more details visit <a href="http://fgxoffice.com/setup" rel="nofollow">office activation</a> today.Kajal Agarwalhttps://www.blogger.com/profile/03940712381864870198noreply@blogger.comtag:blogger.com,1999:blog-426922399870577072.post-26806919201514277012019-12-18T23:38:51.311-05:002019-12-18T23:38:51.311-05:00mcafee enter product key code - Shielding the comp...<a href="https://mcafee.comactivate.uk.com" rel="nofollow">mcafee enter product key code</a> - Shielding the computing devices against dangerous online threats, malware, phishing scams, Trojan horses and other infections.Kajal Agarwalhttps://www.blogger.com/profile/03940712381864870198noreply@blogger.comtag:blogger.com,1999:blog-426922399870577072.post-91067811828956525392013-10-04T05:43:31.175-04:002013-10-04T05:43:31.175-04:00Nowadays, smart businesses and industries are opti...Nowadays, smart businesses and industries are opting for this <a href="http://www.inhouseencap.com/catalogues.html" rel="nofollow">long run encapsulation</a> on those products that serves the most essential or influential components of their businesses. These actually are essential objects that promote sales and purchases and offers a handful of benefits for the company.Anonymoushttps://www.blogger.com/profile/16337325689535038331noreply@blogger.comtag:blogger.com,1999:blog-426922399870577072.post-27125640039290188952009-07-10T18:35:15.128-04:002009-07-10T18:35:15.128-04:00Ken, your "Denormalization Patterns" lin...Ken, your "Denormalization Patterns" link has stray characters at the end. Thanks for the great article!<br /><br />(by the way, have you considered running a spider to check for dead links on your page? Eliminates these problems)Alan Shieldshttps://www.blogger.com/profile/10476963834247880658noreply@blogger.comtag:blogger.com,1999:blog-426922399870577072.post-9025362429599913272009-04-11T09:36:00.000-04:002009-04-11T09:36:00.000-04:00@hanh: The concerns you mention are all very real ...@hanh: The concerns you mention are all very real if you code the triggers manually. When the triggers are coded by programmers, you simply move all of your complexity from app code to trigger code.<BR/><BR/>But there is a better way.<BR/><BR/>First, recognize that all application code executes operations that fall into patterns. Or, put another way, a person who understands the patterns will always be able to see them, and a person who does not recognize them will swear they are impossible.<BR/><BR/>Because the application's actions fall into patterns, an entire application can be described in meta-data, most of it comes down to formulas and rules about columns.<BR/><BR/>Once you have a body of meta-data, you can generate the triggers. This is what I do. I spend my time writing descriptions of databases that include formulas, rules for writing to history tables, security and so forth, and my builder program writes the triggers for me.KenDownshttps://www.blogger.com/profile/11117175783163937575noreply@blogger.comtag:blogger.com,1999:blog-426922399870577072.post-16505444232959451642009-04-10T17:50:00.000-04:002009-04-10T17:50:00.000-04:00Ken, than you for this blog. I enjoy it very much...Ken, than you for this blog. I enjoy it very much. Please allow me a few questions related to this discussion, which perhaps you can expound on in a later blog. <BR/><BR/>In a complex system, would not extensive use of triggers and their cascading effects create problems extremely difficult to diagnose in the real world? For example: Trigger A modifies Table B, trigger B modifies Table A >> loop? <BR/><BR/>Can subversion be implemented with appropriate permission control of the stored procs/functions? For example: If function playlist_before_row_func() is owned by user X and is executable by user Y, would that prevent subversion by user Y of the code controlled by X (and the tables over which that code operates) while allowing Y more control over the code execution? <BR/><BR/>The problem with extensive use of triggers in large systems is the issue of tracing and diagnostics related to the complexity of the trigger interactions. The big picture must be understood and considered at all times, which in a sense negates the benefits of encapsulation. <BR/><BR/>When data is changed, tracking that change back to the source action can be (too) complex especially if more than 1 triggers is involved on the same table, and where cascading of trigger effects are in place. Modifying a system with triggers can be much more daunting than one where all functions/procs are executed in a more "controlled" (per the developer/app) manner. For myself, that is the main reason I have stayed shy of extensive use of triggers outside simply generating unique primary keys.Hanhnoreply@blogger.comtag:blogger.com,1999:blog-426922399870577072.post-77450708002095440242009-01-20T11:00:00.000-05:002009-01-20T11:00:00.000-05:00@eric, yes the trigger raises the error. At this ...@eric, yes the trigger raises the error. At this time I have no meta-data in the framework, the text of the errors is hard-coded.<BR/><BR/>The use of the error # and the column id is meant to allow an application programmer to hook in his own errors if need-be, as one of my customers has done.KenDownshttps://www.blogger.com/profile/11117175783163937575noreply@blogger.comtag:blogger.com,1999:blog-426922399870577072.post-20578133362195270992009-01-19T11:30:00.000-05:002009-01-19T11:30:00.000-05:00I suppose you have the trigger raised an exception...I suppose you have the trigger raised an exception with a string that holds the semi-comma delimited list of errors? Does it translate as a meta data in your project Andromeda or is it something you have to hand-code within the trigger?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-426922399870577072.post-10446814603377635182009-01-19T08:25:00.000-05:002009-01-19T08:25:00.000-05:00@ericdes: For error messages I provide a semi-colo...@ericdes: For error messages I provide a semi-colon delimited list of errors. Each error contains a comma-delimited list of 3 pieces of info, a #, the affected column, and a string. The use of the error # allows app programmers to have their own table of text messages to replace mine, and it also hooks the system for future i18n efforts.KenDownshttps://www.blogger.com/profile/11117175783163937575noreply@blogger.comtag:blogger.com,1999:blog-426922399870577072.post-11249031414092106662009-01-19T00:52:00.000-05:002009-01-19T00:52:00.000-05:00I don't mind putting the logic at the database lev...I don't mind putting the logic at the database level -- but when an action is forbidden what kind of error message will display for the end user? When I validate an entry (e.g. "#", ";", "'" are not authorized in a username) I take the extra step of returning the exact error message, such as 'You cannot put the character # in the username' and not only 'Invalid character(s) in the username', which is relatively easy to accomplish when coding at the application level. What about the messages returned by the rdbms?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-426922399870577072.post-86308328871861085722008-08-30T10:09:00.000-04:002008-08-30T10:09:00.000-04:00Mrclay: I do not think you are off base. You can...<A HREF="http://mrclay.org/" REL="nofollow">Mrclay:</A> I do not think you are off base. You can make an application safe for multiple-access with such strategies as row locking, but IMHO this is quite inferior to encapsulating the biz logic with the tables by using triggers.KenDownshttps://www.blogger.com/profile/11117175783163937575noreply@blogger.comtag:blogger.com,1999:blog-426922399870577072.post-66632476694930202622008-08-28T16:09:00.000-04:002008-08-28T16:09:00.000-04:00Ken: it was too early! I was trying to say that, w...Ken: it was too early! I was trying to say that, with no integrity enforcement in the DB, even if you only use a single app to do writes, if that app is a PHP web app w/ simultaneous users causing writes, this could be "unsafe".<BR/><BR/>Am I off-base here?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-426922399870577072.post-62600900998420374772008-08-28T09:56:00.000-04:002008-08-28T09:56:00.000-04:00Mrclay: I do not understand your comment.Since db'...<A HREF="http://mrclay.org/" REL="nofollow">Mrclay</A>: I do not understand your comment.<BR/><BR/>Since db's are inherently multi-user I did not "forget" to mention anything about multi-user restrictions. Can you clarify?KenDownshttps://www.blogger.com/profile/11117175783163937575noreply@blogger.comtag:blogger.com,1999:blog-426922399870577072.post-25424720092378027302008-08-28T05:20:00.000-04:002008-08-28T05:20:00.000-04:00"If you put the logic into the application, then y..."If you put the logic into the application, then you can only write to the database safely through the app."<BR/><BR/>You forgot to mention only one <I>instance</I> of the DB writing code can be running at one time (basically impossible to enforce in, say, a PHP app).Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-426922399870577072.post-30217374064828325302008-05-21T08:51:00.000-04:002008-05-21T08:51:00.000-04:00Ken you are right, the choice to use or not to use...Ken you are right, the choice to use or not to use triggers mostly depend on the needs like anything else.<BR/><BR/>Additionally the performance view was recently discussed at the Oracle OTN forums, the use of SQL inside triggers may result parsing problem for heavy OLTP kind of applications, here is a small example;<BR/><BR/>http://tinyurl.com/4pt27l<BR/><BR/>To my experience on Oracle databases moving SQL from the triggers into PL/SQL packages, functions, procedures and call only PL/SQL from triggers helps.Tonguçhttps://www.blogger.com/profile/10296956337243833265noreply@blogger.comtag:blogger.com,1999:blog-426922399870577072.post-69488403152034406342008-05-21T08:38:00.000-04:002008-05-21T08:38:00.000-04:00oraclenerd: Many reasons. The main reason cited ...oraclenerd: Many reasons. The main reason cited in the article was to prevent subversion. If you put the logic into the application, then you can only write to the database safely through the app. In some cases this is ok, but in my world of business apps it is very much not ok. We have to know that the database can be accessed from any source and still be able to "defend itself" from accident and malice. There are also performance issues, but the subversion thing is the big deal, that's why I conceptually linked it to the OOP concept of encapsulation.KenDownshttps://www.blogger.com/profile/11117175783163937575noreply@blogger.comtag:blogger.com,1999:blog-426922399870577072.post-15236441759218614882008-05-21T08:24:00.000-04:002008-05-21T08:24:00.000-04:00Tonguç: I cannot dispute the experience you list i...Tonguç: I cannot dispute the experience you list in your blog, but you don't have to give up the advantages of triggers, it comes down to how you respond to these realities.<BR/><BR/>I suspect that we differ in our approach in that I make exclusive use of a data dictionary (which will be introduced in next week's essay). The data dictionary defines the "automagic" features, which themselves follow very strictly the denormalization patterns I have listed on this blog. The approach is to generate the trigger code and the documentation simultaneously from the dictionary, so that the first two problems you list in your link do not exist for me. The third issue also does not exist for me, but that is larger than I can get into in a comment, I will note only that it also centers on using the data dictionary and a strong build program to generate all of the DML.KenDownshttps://www.blogger.com/profile/11117175783163937575noreply@blogger.comtag:blogger.com,1999:blog-426922399870577072.post-26431923309311752632008-05-20T01:46:00.000-04:002008-05-20T01:46:00.000-04:00In my opinion triggers are like fast-food, delicio...In my opinion triggers are like fast-food, delicious in short-term but harmful in long-term, here I share some examples to support my opinion;<BR/><BR/>http://tinyurl.com/54wct6Tonguçhttps://www.blogger.com/profile/10296956337243833265noreply@blogger.comtag:blogger.com,1999:blog-426922399870577072.post-9503816297554835162008-05-19T23:54:00.000-04:002008-05-19T23:54:00.000-04:00Ken,Why use triggers at all? Why not just put the...Ken,<BR/><BR/>Why use triggers at all? Why not just put the logic you would put in your trigger into the procedure/function which inserts the row?<BR/><BR/>chetoraclenerdhttps://www.blogger.com/profile/12412013306950057961noreply@blogger.com