Re: [sqlite] Structured or Object-Oriented?
> If you're using Visual C# Express 2005 (or any 2005 product) then you may as > well go for broke and learn the ADO.NET 2.0 framework. I wrote/maintain a > fairly decent SQLite ADO.NET 2.0 Provider at http://sqlite.phxsoftware.com > and make myself available on the forums quite a bit. > > Robert I think Aaron is working in Mono: how would that work out on Linux for connecting to SQLite through DotNet (I presume that ADO.Net is Windows only!); I was suggesting that he convert VB code to C# in VisualStudio; I'm interested in the solution you propose and will have a go at it after Easter regards, Kevin
Re: [sqlite] Re: Structured or Object-Oriented
> These days they teach the Philosophy of Science, and students get to > understand why Mathematicians are awarded Arts not Science degrees. > > Although it seems highly pedantic it is actually very important that > programmers have an insight into what they are really doing if they are > to advance the art. Are algorithms discovered or invented? Modern > opinion is that they are invented and hence can be patented, not > discovered like the laws of gravity etc, which are definitely not > patentable. That puts computing into the arts area along with mathematics. > JS By the logic you propose you would have to place Biology, Chemistry, Physics and Engineering in the field of Arts; Had Einstein been more astute he could have patented e=mc squared and claimed intellectual property rights every time matter was converted into energy in an atomic bomb (If I hadn't given you the idea you couldn't have done it. If it explodes you owe me royalties). If an algorithm is patentable, why not a formula? Is a formula a one step algorithm, or is an algorithm a sequence of formulae? (I am not asking for a serious reply to this one!!) Patentability hardly clarifies the issue: there is little 'Art' in a Biogenetics company patenting the genetic code of a still living man with a genetic malady: more artful than artefice, and I think I smell the whiff of money; Philosophy, the love of sophistry, Science, the knowledge of something, and Art, the ability to apply knowledge to doing something, in the classical sense, together with the more modern idea that the practically useful is Science and that the culturally edifying though inessential is Art, in a sense, has only served to fudge the issue, as does the whimsical conferment of diplomas by category in educational institutions (Where shall we put Maths this year, Arts or Sciences?); The debate over Art and Science is an old one (and incidentally we are very, very Off Topic): though 'mixing' from between disciplines is decidedly healthy (a little bit of lateral thinking does you good); I have to say that most programmers are not good at lateral thinking (locked in to certain ways of thinking: too much Maths perhaps);
Re: [sqlite] Re: Structured or Object-Oriented
- Original Message - From: "John Stanton" <[EMAIL PROTECTED]> To:Sent: Saturday, April 15, 2006 12:09 AM Subject: Re: [sqlite] Re: Structured or Object-Oriented > [EMAIL PROTECTED] wrote: > > - Original Message - > > From: "John Stanton" <[EMAIL PROTECTED]> > > To: > > Sent: Friday, April 14, 2006 1:32 AM > > Subject: Re: [sqlite] Re: Structured or Object-Oriented > > > > > > > > > >>I was always impressed with Dijkstra's contention that a programmer's > >>most important quality is a familiarity and skill with mathematics. The > >>ability to think in abstract terms and understand the concept of proof > >>of correctness is certainly more important than learning a certain > >>methodology and blindly applying it. > >>JS > > > > > > I agree with the basic idea except in that it does not really relate to > > mathematics as such: > > 'The ability to think in abstract terms and understand the concept of proof > > of correctness' could be considered a basic principle of philosophy and by > > application of science; > > In the 1970's I was studying biology and the most earth shattering > > concept/rule that came my way was 'always relate structure to function', a > > principle which 'encapsulates' OOP in five words (or four if you remove the > > 'always'); > > Biology in the evolutionary sense is not concerned with correctness but with > > the 'fittest', that is, that which functions best; > > there is no proof, correctness or methodology, only that which works; > > > > > There is no correctness in Science, and that certainly applies to > Biology. The scientific method has no "correct", only hypothesis and > observation. On the other hand Mathematics, a non-scientific > discipline, has absolute correctness by proof. "Computer Science" is a > bad term for a discipline which is based on the concepts of Mathematics, > not Science. I would not myself have excluded Mathematics from the Sciences: I have always regarded it as the most abstract of the sciences; Whereas this abstraction is sometimes its strength in relation to computer science, it is sometimes its weakness: sometimes programmers are so cocooned in their abstract internal world they seem often to have difficulty interfacing with the 'real' world sufficiently to come up with efficient practical solutions (unable to relate structure to function!); > > As you would have discovered from biology, the principles of natural > selection etc do not guarantee good designs, only ones good enough to > survive until driven to extinction by a better combination. That's my whole point: the 'good' designs are the ones which exist; Mathematics is also undergoing its own evolution. > For example > the genetic code is not elegantly designed by a mathematician but is > just the first combination which worked adequately. If the biological > method worked well there would be no disease or genetic defects, just > organisms which lived forever like Euclid's axioms. The biological method works 'well': disease and genetic 'defects' are simply aspects in the unfolding of the genetic code. Euclid's axioms don't exist in the real world, they are human abstractions: it may be possible to prove that there is a relation between the radius of a perfect circle and its circumference, but unfortunately the perfect circle does not exist, therefore no radius and no circumference. It's interesting that you use words like 'good', 'better', 'elegant', 'defect', 'correct' in ways that imply value judgement, where as a biologist I would usually say more or less functional: you notice that I used Darwin's term 'fit': I think that programmers should strive for the 'fit' solution; > > I would counsel programmers to look to correct designs rather than > pursue the biological approach and be like a monkey running up and down > a keyboard in an attempt to compose a new sonata. The biological analogy that I proposed was based on the fact that most biological study is based on the structure/function dichotomy, and that anybody in computing could benefit from such a simple paradigm; That you cited the sonata as an example of correct design is interesting, in that the rules of correct design do serve as tools to composition, though the uniqueness of expression in the sonata will often derive from a knowledgable breaking of those rules: trying to define poetry or music using Euclid would probably hardly satisfy; Neuroscientists might differ, though they will have a few books of theorems to produce yet. I am not trying to underplay the importance of mathematics, but I suggest that other disciplines (in my case biology and general sciences, precision craftsmanship and design, and musical training) can also contribute to working in computing. P.S. If anything its the programmers who resemble a monkey running up and down a keyboard in an attempt to compose a new opus (I include myself in that forlorn brood) Happy Easter Kevin
Re: [sqlite] Structured or Object-Oriented?
>- Original Message - >From: "Aaron Jones" <[EMAIL PROTECTED]> >To:>Sent: Friday, April 14, 2006 12:05 PM >Subject: Re: [sqlite] Structured or Object-Oriented? > >Hi John, I fully understand, and if It wasn't for my final degree I would >simply just go with the flow, but I have to choose a method and justify why >I chose it, which is doing my headin at the moment. lol > >Thanks for your comments. > >Aaron. The arguments for using OOP could be high modularity, encapsulation of SQLite database functionality, multiple instances and heredity, association of data with its related methods, the fact that the language and platform you are using (C# and DotNet no?) is already strongly OO. As I understand it, structured programming does not actually exclude OO: maybe your tutor is putting you under test to make sure you have a good grasp of the fundamentals; The nice thing about OOP is that you can make it self commenting: If DatabaseIsConnected then OpenMainModule else TellUserDatabaseIsDown; CloseProgram; (Pseudocode) The four methods (DatabaseIsConnected, OpenMainModule, TellUserDatabaseIsDown, CloseProgram) can then be reduced in their internals to the same type of structure (in its way a form of structural or at least procedural programming); In your situation I would have a real blitz on OOP: it's not just theory, it will be extremely useful in the real world (many of the worst problems I have seen in my recent collaborations would have been avoided with prior rigorous application of OO from their beginnings: someone with a good grasp of OO would simply not create certain structures);
Re: [sqlite] Re: Structured or Object-Oriented
- Original Message - From: "John Stanton" <[EMAIL PROTECTED]> To:Sent: Friday, April 14, 2006 1:32 AM Subject: Re: [sqlite] Re: Structured or Object-Oriented > > > I was always impressed with Dijkstra's contention that a programmer's > most important quality is a familiarity and skill with mathematics. The > ability to think in abstract terms and understand the concept of proof > of correctness is certainly more important than learning a certain > methodology and blindly applying it. > JS I agree with the basic idea except in that it does not really relate to mathematics as such: 'The ability to think in abstract terms and understand the concept of proof of correctness' could be considered a basic principle of philosophy and by application of science; In the 1970's I was studying biology and the most earth shattering concept/rule that came my way was 'always relate structure to function', a principle which 'encapsulates' OOP in five words (or four if you remove the 'always'); Biology in the evolutionary sense is not concerned with correctness but with the 'fittest', that is, that which functions best; there is no proof, correctness or methodology, only that which works;
Re: [sqlite] Structured or Object-Oriented?
I have been doing various experiments in applying OO to databases and might have a few suggestions to make. I would be interested to provoke debate as to how to apply OOP to a database like SQLite; I haven't quite understood why your tutor wants to know if the database is structured using OO: this would affect how you program the server side of the database (not very relevant to SQLite), but the Client side (or user interface) can be created using whatever principles you wish; Oracle has provision for OO, as I understand with a preference for Java oriented programming, though the object oriented structure works also in PL/SQL (PL/SQL and Java are contentious concerning the direction that Oracle will be taking for its programming language: some think that ultimately Java will take over: there is a certain logic in pushing towards using the same language for the frontend as you use for the backend); I have followed SQLite's evolution with interest (as a Delphi programmer now moving towards C# and possibly Java), though as I understand it, SQLite isn't (yet?) structured towards using objects as part of its internal programming language; Oracle has the 'package' which internally groups functions and procedures together with variable declarations: a good way of applying OOP since it favours modularity; Oracle has also the Object Type, the object Table and the Object View (the Object Type is analogous to the Class in C++ or Java) and all the usual elements of OOP (Inheritance, Encapsulation, Polymorphism etc.); I presume that to apply a similar structure to SQLite, it would require the development of an outer object-oriented 'shell' which would have the non object-oriented SQlite 'motor' at its core: the database 'objects' would have to persist in the database in some way (presumably implying that the database contains a structure which would create and maintain them); Normally Objects on the database side would be part of a database server and would imply the use of a complex language interpreter on the server side (SQLite is not really a server in this sense and has only a simple internal language: Lite after all!!); In Delphi, I made a multi tier program, which was object-oriented, using COM and dbexpress to connect to SQLite : when a module was called on the client, instructions were sent to the client server which then created its data objects dynamically by means of COM function calls, opened a session with the database etc Another set of instructions from the client executed functions on the client server which sent the corresponding SQL instructions to the database; On the client I created instanced 'Table_Objects', one for each table I wanted to use: these had various methods that I inherited from an ancestor TableObjectType (insert, update, delete etc): just calling these functions with the field values caused the SQL script to be parsed and executed on the server; any 'stored procedure' type functionality would be done by creating specific OO structures (in this case using Delphi) on the server side; (Obviously the client, server and SQLite modules can be on separate computers, though the concept is really for multiple clients) As far as your project is concerned, you could propose writing an object oriented module that could work as the 'client server' part: this would dialog with the SQLite database and with all instances of the clients by opening an 'SQLite session' for each; a second 'client module' could manage 'table objects' which encapsulate the stuctures on the database and which retrieve user data as required and which update the database by dialoguing with the client server; (the end result would be a bit like one of the heavyweight RDBMS's like Oracle, except that it would be lightweight and it would be exclusively object oriented in that there is no need for a second 'server side language' like PL/SQL or whatever, since this functionality is 'compiled in' on the server and on the client but not required in the database 'motor' itself); As I understand, you are working in C#: I have been working on a project in C# for generating code from the database table structure which will encapsulate table functions in a TableObject (as described above in Delphi except that I wrote the code by hand, whereas the C# program generates it): the generated code that it exports creates a descendant object in C# (or Delphi or Java) which in turn can execute SQL scripts in a single or multitier situation depending on where you decide to place the objects and how you connect to the database (if you go for single tier you could compile the 'client' and 'client server' functionality into the same executable, though you would maintain clarity by keeping their modularity distinct and separate); Hope my comments are useful, and I would appreciate any feedback, regards, Kevin O'Neill
Re: [sqlite] again on sqlite as a standard, was: SQLite and OOo
I was wondering if internal functions saving to and from an XML data file (an XML file dumper?) might be sufficient to export/import from SQLite standard datafile (I mean without having all the data in the same file, but having multiple files); in any case, export/import functions might be part of the SQLite library file or alternatively as part of the program that is using the library; You could perhaps have separate XML files for each table or whatever; Importation of an XML file would have to be within the constraints of the SQLite data structure in any case; On the other hand I am not sure why there is really a problem: it might be simpler just to add SQLite compatibility to any program like OpenOffice if they want to have SQLite as a standard, it seems to me that SQLite is appearing on most platforms anyway! Kevin O'Neill - Original Message - From: "D. Richard Hipp" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, July 24, 2004 11:29 PM Subject: Re: [sqlite] again on sqlite as a standard, was: SQLite and OOo > M. Fioretti wrote: > > > >>The main drawback of SQLite is that it doesn't support ALTER > >>TABLE. It's a big limitation for simple users when building a > >>database. If this fonctionnality (and a few others) could be add in > >>a near future, SQLite would probably become the first choice for > >>OOo. > >> > > > > ALTER TABLE will probably start appearing (in stages) over the > next several months. Rename table and rename column will appear > first. Then add column and drop column. Finally add and drop > constraints. > > > > > 2) > > > >>So I hope that SQLite developpers will be able to work together with > >>OOo developpers to write an embeded OOo driver for SQLite (not > >>ODBC), and then to store SQLite database in the future OOo base file > >>format. > > > > Storing an SQLite database as part of a larger file is problematic. > (1) The SQLite database section needs to be contiguous and it > needs to be growable. So at the very least, it would need to be > at the end of the larger file. (2) If stored as part of a larger > file, standard tools (such as sqlite3.exe) would not be able to > read it since they would not know where to look for the start of > the database. (3) SQLite needs a separate rollback journal file > in order to support ACID transactions. Perhaps these objections > could be overcome if I better understood the problem. > > > -- > D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565 >
Re: [sqlite] sqliteOsEnterMutex() and sqliteOsLeaveMutex()
>> as someone who's trying to give up smoking, had to contribute to this >> thread. >> Warning: Windows can damage your health (and perhaps that of others: Passive Computing); >> "OS" and ""windows" in the same sentence ??? Ha. If you try to use a toy >> as >> a real tool for real work, it's bound to break. >> > >(sorry, couldn't resist. :-) >> >> Derrell > - second, i wish people would keep politics and religion out of this forum > (""OS" and ""windows" in the same sentence ??? Ha.") windows has > contributed more to the economic health of this planet that any other > single technology. I think penicillin and learning to sharpen flint were as important if not more so! Food has also contributed to the health of this planet, but, tastewise, there is good food and there is bad food, even though both might have similar nutritional value; Religions often suggest what we might be theoretically capable of, their practical application being rather a disappointing mix of failure to live up to the ethics proposed and a desire to eliminate alternatives (spot the analogy with operating systems if you dare). I can actually conceive of an OS that I would consider ideal, the market reality being Windows however; The principle of the "open" market has the inbuilt flaw that if it is truly open it inevitably leads to a monopoly (Microsoft being possibly the best historical example to date); So as not to be completely OT, I send best wishes to all involved with SQLite development and testing. I am interested to see SQLite being proposed for a cross platform Open Source database engine: it is interesting to note that forty years of commercial competition has not really proposed a viable standard for such a database engine (too much proprietory vested interest to permit such a thing?), the usual case of what the supplier can sell being more important than what the client needs to use: end result: the "client", in this case the serious database user, collaborates with others of that ilk to produce what he himself needs to use: Since SQLite might be moving in this direction, I suppose it might be a good thing if the 'standard' database engine moves towards the 'standard' database format, by which I mean XML import/export; this can be arranged secondarily by whatever frontend is being used but I suppose standard XML import/export functions might be a good thing, perhaps eventually using XML as the primary file format (I know its bulky but it is more or less a standard and memory and disks are huge); K. O'Neill - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, July 16, 2004 10:50 AM Subject: Re: [sqlite] sqliteOsEnterMutex() and sqliteOsLeaveMutex() > > > > > > as someone who's trying to give up smoking, had to contribute to this > thread. > > - first of all the generalisation about using multiple threads is > misguided. its low level work, you need to be careful, and applications > need to be architected so that most programmers working on the project > don't need to worry about multithreading issues. using multiple processes > has similiar problems when trying to access shared resources - race > conditions, deadlocks etc. the only obvious difference is that in a > multi-process approach you don't get to share the same memory structures by > default, and so don't need semaphores etc guarding them. > >