Re: [WebDNA] Was: wiki Now: Object-oriented programmng
This WebDNA talk-list message is from 2009
It keeps the original formatting.
numero = 103974
interpreted = N
texte = Brian Fries wrote:> One can utilize object-oriented techniques while programming in any > language. This doesn't make the language itself object-oriented, but > that's ok. WebDNA does not need to be object-oriented, and in fact > dealing with the overhead of object-oriented interpretation would slow > down the execution of WebDNA code. Object-orientation benefits the > programer in that s/he inherits extensive capability with relatively > little coding, but it puts more load on the system interpreting the > code. For a compiled application, this is great, as the interpretation > only happens when the application is built. In a live-interpreted > language such as WebDNA, more work would need to be done by the WebDNA > engine every time a page is loaded, and that would slow down the > processing.> > I use object-oriented techniques in WebDNA frequently, through careful > implementation of function libraries. I have found that when done with > care, this can be very effective, but when I get sloppy the system bogs > down. I have spent a fair amount of time working through these issues in > order to optimize my code and find the best balance I can between ease > of development and web page performance.> > As an illustration, I have a series of very similar websites or sections > within a website. These all use the same core function library include > file. At the end of that function library, which is stored in a global > directory, it looks in the local directory of the page being loaded for > a local include file. If found, that include file is loaded, which may > replace or add to variables and functions defined in the master include > file. This provides the basic concept of "inheritance" that is core to > object-orientation. Essentially, each implementation of a module shares > a common class of properties (text variables) and methods (functions), > then redefines the pieces that make the instance of the module unique. > Changes to the parent class (the global include file) are automatically > inherited by the child classes (local module implementations), and > features of the parent class can be overridden by local implementations. > WebDNA makes this possible because when you define a function or a > variable, it replaces any previous definition using the same name.> > This is object-oriented programming using structured or procedural > tools. Since it is not managed or enforced by WebDNA, that does not make > WebDNA an object-oriented language, but that works for me because I have > the choice to use these techniques or not, as the development and > performance needs of a particular project dictate.> > Brian Fries> BrainScan SoftwareVery well said Brian and of which, I think, reflects the accuracy of what my first live wiki version stated:http://en.wikipedia.org/w/index.php?title=WebDNA&oldid=323969695This:"..andfeatures of the parent class can be overridden by local implementations.WebDNA makes this possible because when you define a function or avariable, it replaces any previous definition using the same name."is of a particularly good point regarding OOP methods regarding WebDNA.Thanks for the thorough comments, as always!DonovanP.S., noting some of the commenters... I agree that OOP methodologies can easily fall into the "over kill" or "not needed" categories for WebDNA solutions. WebDNA is a rare breed and it "thinks different" fromother languages.-- Donovan BrookeWebDNA Software Corporationhttp://www.webdna.us**[Square Bracket Utopia]**
Associated Messages, from the most recent to the oldest:
Brian Fries wrote:> One can utilize object-oriented techniques while programming in any > language. This doesn't make the language itself object-oriented, but > that's ok. WebDNA does not need to be object-oriented, and in fact > dealing with the overhead of object-oriented interpretation would slow > down the execution of WebDNA code. Object-orientation benefits the > programer in that s/he inherits extensive capability with relatively > little coding, but it puts more load on the system interpreting the > code. For a compiled application, this is great, as the interpretation > only happens when the application is built. In a live-interpreted > language such as WebDNA, more work would need to be done by the WebDNA > engine every time a page is loaded, and that would slow down the > processing.> > I use object-oriented techniques in WebDNA frequently, through careful > implementation of function libraries. I have found that when done with > care, this can be very effective, but when I get sloppy the system bogs > down. I have spent a fair amount of time working through these issues in > order to optimize my code and find the best balance I can between ease > of development and web page performance.> > As an illustration, I have a series of very similar websites or sections > within a website. These all use the same core function library include > file. At the end of that function library, which is stored in a global > directory, it looks in the local directory of the page being loaded for > a local include file. If found, that include file is loaded, which may > replace or add to variables and functions defined in the master include > file. This provides the basic concept of "inheritance" that is core to > object-orientation. Essentially, each implementation of a module shares > a common class of properties (text variables) and methods (functions), > then redefines the pieces that make the instance of the module unique. > Changes to the parent class (the global include file) are automatically > inherited by the child classes (local module implementations), and > features of the parent class can be overridden by local implementations. > WebDNA makes this possible because when you define a function or a > variable, it replaces any previous definition using the same name.> > This is object-oriented programming using structured or procedural > tools. Since it is not managed or enforced by WebDNA, that does not make > WebDNA an object-oriented language, but that works for me because I have > the choice to use these techniques or not, as the development and > performance needs of a particular project dictate.> > Brian Fries> BrainScan SoftwareVery well said Brian and of which, I think, reflects the accuracy of what my first live wiki version stated:http://en.wikipedia.org/w/index.php?title=WebDNA&oldid=323969695This:"..andfeatures of the parent class can be overridden by local implementations.WebDNA makes this possible because when you define a function or avariable, it replaces any previous definition using the same name."is of a particularly good point regarding OOP methods regarding WebDNA.Thanks for the thorough comments, as always!DonovanP.S., noting some of the commenters... I agree that OOP methodologies can easily fall into the "over kill" or "not needed" categories for WebDNA solutions. WebDNA is a rare breed and it "thinks different" fromother languages.-- Donovan BrookeWebDNA Software Corporationhttp://www.webdna.us**[Square Bracket Utopia]**
Donovan Brooke
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
[WebDNA] a major shift in strategy? (2008)
all records returned. (1997)
Web Catalog 2 demo (1997)
This is probably a stupid question... (2004)
Forcing price recalculation in shopping cart (1998)
No luck with taxes (1997)
math problems (2000)
Two prices in shoppingcart? (1997)
[BULK] [WebDNA] [BULK] 7.x and 6.x on same server (2012)
WCS Newbie question (1997)
WebCat2 beta 11 - new prefs ... (1997)
Logging purchases (1997)
Help in Minneapolis (2000)
Rhapsody? (1997)
[OT] (waaaay OT) further off topic than before (2004)
4.5 Upgrade (2003)
[WebDNA] unix timestamp in WebDNA (2009)
Server IP address (2004)
Forms IMG tag[OT] (2001)
[WebDNA] FCGI vs Server Version (2018)