Download presentation
Presentation is loading. Please wait.
Published byRoss Harper Modified over 9 years ago
1
sd&m software design & management GmbH & Co. KG Thomas-Dehler-Straße 27 81737 München Telefon (0 89) 6 38 12-0 Telefax (0 89) 6 38 12-150 http://www.sdm.de 1 Module “Data::Locations” “What on earth are Data::Locations?!” Steffen Beyer YAPC::Europe, London, UK, ICA, September 22-24 2000
2
sd&m 2 Agenda What is it good for? Example How does it work? Gory Details History Questions & Answers, Suggestions
3
sd&m 3 What is it good for? Writing (almost) sequential streams of data, with some portions to be filled in later, after most or all of the stream has already been written - without using temporary files: – Web Content Management – Generating code in large IT projects – Mailings to multiple recipients –...
4
sd&m 4 Example Software Development Environment (Code Generators) Customer:Zeppelin-Caterpillar Development Platform:Unix Tool Language:Perl Production Platform:Mainframe MVS/CICS Production Language:PL/I Costs (just the tools!):approx. 4 man-years
5
sd&m 5 Example See – file "in.txt" – file "out.txt"
6
How does it work? (1/2) 6 sd&m
7
sd&m 7 How does it work? (2/2) Data::Locations are implemented so that they behave as if they were an integral part of the Perl language: – you can send data to Data::Locations with "print" like to any other filehandle – you can read from Data::Locations with the "<>" operator as usual – Data::Locations go out of scope as any other Perl object – Data::Locations are fully suited for binary data – Data::Locations can be automatically dumped to a file, a pipe, a command etc. when program ends
8
sd&m 8 Cookie – You can teach people with your head – You can kill people with an overhead – You can overkill people with two overheads
9
sd&m 9 Gory Details See – file "struct0.pl" – file "struct1.pl" – file "struct1.txt"
10
sd&m 10 Data::Locations are typeglobs, filehandles and objects at the same time The typeglob is blessed into the Data::Locations class The filehandle is tied to the object (i.e., to itself, because Perl confuses typeglobs and filehandles) The typeglob's slots ($, @, %) contain the object's data (the "@" slot actually contains the user's data) Symbolic references are used as "weak references" for internal interconnections The reference count is adjusted so that the Location will be destroyed when user's last reference goes out of scope The symbol table %Data::Locations:: is used as index (for "weak reference" lookups and global destruction)
11
sd&m 11 History 80’s 1988/1989 July 1997 :“Delta” macro processor (Delta GmbH) :“ProMAC” macro processor (sd&m GmbH) :Perl module “Data::Locations” (Free Software)
12
sd&m 12 DELTA macro processor Product of Delta GmbH Macro preprocessor to extend the capabilities of COBOL and PL/I extendable with the help of a “PDL macro generator” very cryptic poor performance hard-coded memory limits
13
sd&m 13 ProMAC macro processor String interpolation reminding of C preprocessor built-in functions comparable to Perl Regular expressions (similar to “egrep”) “Module concept”: every subroutine is a separate file Disastrous performance: 100% interpreted (even in loops) Conceptual weaknesses
14
sd&m 14 Questions & Answers, Suggestions Please feel free to ask! Suggestions are welcome.
15
sd&m 15 Another Example Web Content Management Customer:Pentium GCC Group (http://www.goof.com/pcg/) Contact:Marc Lehmann Application:Generating status pages with bug reports for different releases and branches of development
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.