Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!cimshop!davidm From: cimshop!davidm@uunet.UU.NET (David S. Masterson) Newsgroups: comp.object Subject: Re: Object-Oriented COBOL? Message-ID: Date: 9 Nov 90 18:04:53 GMT References: <679@dlogics.COM> Sender: davidm@cimshop.UUCP Distribution: comp Organization: Consilium Inc., Mountain View, California. Lines: 27 In-reply-to: dsa@dlogics.COM's message of 8 Nov 90 17:49:33 GMT In article <679@dlogics.COM> dsa@dlogics.COM (David Angulo) writes: I originally thought that this would be the way to design the classes - have a class interface to the SQL/relational database. The problem with this is that you can't use embedded SQL code with this approach because you must hard code the table name. I suppose you could use dynamic SQL but.... It's easier to just have each object implement methods to access the database. For example, Class::insert(), Class::modify(), .... The problems with this is that you end up making a LOT of these for specific accessing needs (see my article of yesterday for more info). I kind of see this as a cost/benefit problem. Implementing the system using dynamic SQL would allow the system to grow more easily as new entities are added to the system, but the startup cost would be more difficult than static SQL to the individual tables. On the other hand, static SQL would make it easy to write functions like Class::insert(), Class::modify(), etc. for each entity (table) in the database, but, if you have a large number of tables, you'd eventually have a significant maintainance problem on the repetitious code when you need to make global changes (like changes in locking methods or table history). Sort of a "pay me now or pay me later" scenario. -- ==================================================================== David Masterson Consilium, Inc. (415) 691-6311 640 Clyde Ct. uunet!cimshop!davidm Mtn. View, CA 94043 ==================================================================== "If someone thinks they know what I said, then I didn't say it!"