oracle - PL/SQL private object method -


Oracle's PL / SQL (using 10G) I'm a little new, I was wondering if there is a way to do this in a personal type of object type, as often as other languages ​​(Java, C ++, C # Etc etc.) are used for personal accessory methods. It is possible to do personalized methods in the address package, but I can not find a way to do this for object types. I am telling compiler errors:

 Error: PLS-00539: Subprogramme 'FOO' is declared in object type body and defined in object type specificity. 

OK, here's a possible solution that I have tested very briefly, and it's still Works:

The parent object type that will be marked as not final and undesirable and then put all the private code there. Private methods will not really be private, but putting them in such a way that is not the last and prevents them from calling them instantly. In the immediate subtype, refer to "private" methods in SuperTem via SELF. Example:

  Type the privatefu (member process setUpCommonFoo) under Superfu, not INSTANTIABLE; Creating or changing a private body type - Member procedures and methodology set up the member process setCommunfu starts SELF.SomeAttrib: '' Some Common Default Values'; End; End; Type or fuse type fu under the personal foo (resultant constructor function Foo return results as SELF, Constructor Function Fu Return results as SELF - Suppose that FQ is defined in Superfu, and Fuchi type somewhere Is defined;) The body is for the establishment of Fu - No-erg Constructor Basic Fu. The controller working party converter itself as the result of itself. SetupMeeting FU; Return; End; Free Manufacturer for Other Positions ... Constructor Function Party Convertor (FKI) returns as SELF returns such as the self Staff up Commonfu; SELF.RrelyUsedAttrib: '' Special Price! '; - Suppose something is attached and rarely used. Atreb is actually present;) self.fkey: = fkey; Return; End; - Other members go here ... end;  

Now I have to accept, I really do not like this pattern. It sounds weird and weird, I'm probably going to avoid the object type as much as I can stick with the package (or very similar object type). A package-of-phariari helps to resolve the private common code problem only for consultants, not for other types of normal code refactoring.

... As long as there is no better way to work with the object type .... Anyone? anyone?


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -