MySQL: Building User Interfaces 266
MySQL: Building User Interfaces | |
author | Matthew Stucky |
pages | 632 |
publisher | New Riders |
rating | 4/10 |
reviewer | Craig Maloney |
ISBN | 073571049X |
summary | MySQL and GTK+ are used to create cross-platform applications, with copious code listings. |
What's in the book?
The first chapter guides the reader through the basics of MySQL and how it compares to Access 2000 and SQL Server 97. Next, a code listing demonstrates the basics of connecting to MySQL via C using the MySQL C API. the book gives an all-too-brief whirlwind tour to the basics of MySQL. The next four chapters are a tutorial on how to use GTK+ and GLADE, focusing on how these toolkits are similar and different from their Visual Basic counterparts. GTK+ was chosen in this book because of its cross-platform compatibility with both Windows and Linux / UNIX operating environments. The second part of the book takes what was learned about MySQL and GTK+ with GLADE and uses it to create a stand-alone application (a real-world order-entry application).What's Good?
Throughout MySQL: Building User Interfaces, Stuckey describes exactly what he is doing and why he is doing it that way. The introduction to GTK+ in the first part of the book describes just about every GTK+ widget available (menus, buttons, sliders, status bars, etc.), and creates a monster busy-box application (not to be confused with the busy-box application by Bruce Perens) demonstrating those widgets by themselves. Later in the book Stuckey uses Glade to put applications together, but not using Glade early on gives the reader a chance to see what is happening under Glade's abstraction. During the building of the order-entry application, Stuckey explains the design decisions behind the widgets. Each window of the application is introduced first with a diagram describing where the widgets will be followed by the code for each widget. The design looks like a Visual Basic application designed by a a programmer, with an eye toward the functional rather than the aesthetics of user interface design, but as an introduction to GTK+ programming it works well.What's Bad?
If there was ever a book that required a CD-ROM to accompany it, this book gets my nomination. Authors have to walk a fine line between presenting code snippets that don't make sense by themselves, or risk boring readers with page after page of code that might confuse readers who aren't yet ready to view full code listings. MySQL: Building User Interfaces chose to include the full code listing for everything. This is both a blessing and a curse: readers have the code right in front of them and don't have to worry about being in front of a computer while reading the book, but the flow of the book is interrupted every time something is introduced.The descriptions also suffer, because those code listings are expected to explain in more detail what is going on. In the GTK+ introduction, widgets are introduced with short paragraph introductions. The real-world application, which should be the focus of the book, reads like an assembly line: A screen is introduced, the widgets are placed, and the code is listed. Worse, files which make little sense without a computer (such as files generated by glade) are presented along with the code listings. This makes reading this book a chore. Thankfully, there is an FTP site with the code ready to use, but future versions of this book would be best served to include it on disc.
Perhaps a balance can be struck in a future edition where important code concepts are highlighted without sacrificing seeing the code in a meaningful context.
So, what's in it for me?
Windows programmers who need a hand in getting their applications to Linux or UNIX may find this book helpful (but overwhelming) as they learn. This book stands out as a bridge for Windows programmers to make their transition to Linux and UNIX smoother, but the emphasis and amount of code listings in this book may make Windows programmers choose a different route.
You can purchase MySQL: Building User Interfaces from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
Try SQLite (Score:5, Informative)
MS Access has the advantage (on Windows machines anyway) of being a stand-alone database without needing a service to be installed. For a app where you don't want to have to install MySQL server and have it waste resources, you might consider SQLite [sqlite.org]. Unlike MySQL embedded, it's release under the public domain. MySQL Embedded is licensed under the GPL and has the following requirement [mysql.com]:
Although, depending on what you want to do with the software, this may not be a problem. I'm all for free and open source software, but a brother's gotta eat too.
more sellers (Score:4, Informative)
amazon link [amazon.com]
isbn.nu link [isbn.nu]
half.com link [ebay.com]
No affiliate tags are used above. But here's the amazon link [amazon.com] with my tag, if you feel generous.
My opinion (Score:2, Informative)
Make sure you use MySQL version = 4.0 (Score:5, Informative)
Still, I love MySQL. Postgres is more full featured, but for the smallish web-based applications I write, it's overkill.
Kexi is also worth checking out. (Score:4, Informative)
Re:Try SQLite (Score:4, Informative)
MySQL is a service that runs seperately from the application and must be started and stopped seperately. In most cases, the service is started at boot time and runs all the time, wasting resources unless you manually stop it.
I read this book (Score:3, Informative)
never worked with mySQL before. I got this book and was
able to complete a full fledged demo in a matter of three
days, working part time. The book is very well organized,
easy to read and understand and best of all the examples
work without modifications. I highly recommend this book
for beginners. I would have done so for all levels but
I'm not an advanced user of mySQL.
If you're thinking of getting started on mySQL this is the
book.
Re:MySQL Feature Set (Score:3, Informative)
Re:Try SQLite (Score:4, Informative)
Wikipedia has a more thorough discussion here (for SQL) [wikipedia.org] and here (databases in general but quite a read) [wikipedia.org]
Re:Try SQLite (Score:2, Informative)
Re:Try SQLite (Score:4, Informative)
One minor correction (Score:2, Informative)
Not that I'd be interested in a comparison between MySQL and SQL Server (midrange C/S replacement for Access/FoxPro - OK. Enterprise RDBMS? No)... but still.
Re:Try SQLite (Score:2, Informative)
I am in complete agreement.
I write small DB apps for small businesses. My clients all have MS Access installed. I would love to be able to use all open-source tools to develop these apps, but so far nobody can show me something that's as simple for my computer-illiterate clients to install as "Here, copy this .mdb file to your hard drive and double-click on it". Installing one more piece of software wouldn't be hard either, but if I have to say "Here, install OpenOffice first, then install MySQL, make sure it's running, then run this script to put the right data in MySQL, then make sure you have the right MySQL drivers installed, THEN double-click...." You get the idea.
Most people have a hard enough time with "Copy the .mdb file to c:\dbprogram". Requiring them to install a service with appropriate drivers on their old PentiumII running Access2k is a nightmare and suicidal for a small software company.
Re:Try SQLite (Score:2, Informative)
Along those lines, you shouldn't be coding directly to MS Access anyway. Writing your stuff to an ODBC datasource is a much better choice. Luckily, every popular database in existance has an ODBC driver. With ODBC (or ADO) and a client-server database, you can have the database local to you for initial development and then move it off to a dedicated server without changing a single line of code. With a MS Access database, you can have a dedicated fileserver, but locking issues between clients get really hairy after more than a couple of people connect and work at the same time.
SQLite is great if memory constraints are very tight and you probably won't move to a client-server model in the future. How much is a 256MB DIMM these days? 256MB is enough for most relational databases to have a field day with the datasets that MS Access is used to. And memory's only getting cheaper. Make sure that you have a real need to constrain yourself to the in-process model before jumping in.
Also note that if you use an ODBC datasource, you can use the comparatively wonderful Access frontend and have a real data store in the background doing the heavy lifting.
But then, if you really wanted to do it right, you'd use something better than MySQL on that backend like MaxDB, Firebird, or PostgreSQL; Same cost, more features, scale better with concurrent writes, and safer for your data (actually tells you when crap data is trying to find its way in) than MySQL. Remember, if you're talking about replacing MS Access, you're probably not talking about a web environment anymore. Chances are that it's not 99% reads.
Or... Revolution (Score:1, Informative)
Windows, Linux, MacOS 9/X.
Looks much nicer than GTK or Java.
Much easier to script.
MySQL, Postgres, OpenBase, Oracle, ODBC, etc.
Also works with Valentina- a pretty darn fast Mac & Windows embedded database engine.
It's not for everything, but if you want cross-platform RAD, it should be in your bag of tricks.
Re:Try SQLite (Score:3, Informative)
Use Access as a GUI for mySQL! (Score:5, Informative)
Re:Try SQLite (Score:3, Informative)
You're incorrect that this memory will get swapped to disk, since that will only happen if memory becomes low.
The problem with this is that Linux (as do many OS's) has a system of buffers and caches which use unallocated memory to speed up the OS. Having a bunch of memory allocated (but not enough to swap them out to disk) lowers the number of buffers and caches available to the OS, thus decreasing performance.
Finally, whether or not the memory is swapped out to disk, it's still resources, and it's still wasting them if the service isn't being used.
Almost right (Score:2, Informative)
So there still isn't a production-quality MySQL server.
Re:Try SQLite (Score:4, Informative)
So long as you link it correctly, you do not need to release the source code to your application: no matter how confusing the licencing on the MySQL website is...
postgresql syntax conventions? LOL (Score:3, Informative)
And that's comparable?
If you want to read something amazing, go ahead and read the MySQL manuals, look for design deficiencies: http://www.mysql.com/documentation/mysql/bychapte
You'll see more than just minor syntax issues - you'll see that mysql spends most of its time in silent error mode.