Slashdot Log In
Creating Applications with Mozilla
from the lizard-is-the-new-black dept.
| Creating Applications with Mozilla | |
| author | David Boswell, Brian King, Ian Oeschger, Pete Collins & Eric Murphy |
| pages | 454 |
| publisher | O'Reilly |
| rating | 9 |
| reviewer | Peter Wayner |
| ISBN | 0596000529 |
| summary | How to use the Mozilla APIs to do anything. |
On the first and most obvious level, the book is just the typical, thorough treatment of the important APIs that we've come to expect from O'Reilly. There are chapters addressing all of the important layers of the Mozilla platform and plenty of examples that show you how to customize the platform. Some may want to change the icons and others may want to add more robust features. The range of possibilities is surprising and coders are creating one-to-one communications enhancements, add-on widgets, and even games. There are certainly some things missing, and some areas that could use more detail or more complicated examples, but the book is already 454 pages long.
On another level, this book is also one of the first finished documents that explains what the Mozilla group has really been up to for the past five years. Some have abandoned the project, and others have attacked it as fundamentally misguided. This book shows why it took so long by demonstrating all of the cool features added during the long march to a new, thoroughly extensible architecture.
Are the results enough to justify the time and the effort? Some note that the features may be a bit overhyped, because building your own browser with the Mozilla API is like making a pizza with $15 and a telephone. While there's a large part of the book devoted to the work you can do to change the look and feel of the buttons on your browser, the book and the project offer much more. The Mozilla project is one of the biggest threats to simple tools like Visual Basic to come down the pike in some time. The various layers offer many ways to provide good, customizable interfaces to databases, the web, and much more. I can see how many corporate development shops may want to start making Mozilla the platform for a license-free front-end, simply because it's a straightforward tool without extra costs or restrictions.
At the most abstract level, the book is a great way to get a taste of modern software development. Computer scientists sometimes fix problems by adding more and more layers of indirection. This may not solve anything, but at least there are hooks for a real solution to use some time in the future if some one ever does figure out how to make the box do it. The Mozilla browser is one of the most extreme examples of this philosophy to ever emerge. Emacs was something special, but this is even more insane. Everything can be changed around by rewriting some XML and Javascript and most people don't need to juggle the pointers in grubby C to do amazing things. I realize it's not as beautiful as Lisp to some, but it's got a clarity and level of abstraction that's stunning to behold. Lisp was just procedural, while XML is more like logic programming.
This relentless customizability embodies one of the deepest reasons for the success of open source. Technology is inherently complicated and the only way we can use it is if we can look under the hood. You can say all you want about CVS trees and bazaars filled with competing code, but opening up the interface is one of the most powerful themes of open source. It's not about teaching people to build their own VCR or PVR from scratch, getting the VCRs for free or even debugging the VCR's source code -- it's just about making them easy enough to program.
The book illustrates how Mozilla opens up the API to create a relatively easy language for people to use. The real open source is not the C in the tar ball, but the XML interface spelled out in the book. Many people feel that the most important thing that the first browser designers did was make it easy for people to see the HTML tags marking up the document in front of them. The new Mozilla takes this transparency to a new high.
If you look at the book at all of these levels, you can see that this is one of the most important documents to emerge from the open source community in some time. At first glance, it's just another set of APIs for us to wiggle. I realize it's not fair to credit the Mozilla team or the book authors with creating the browser or XML ex nihilio -- they just jumped on some of the most popular bitwagons propagating across the Net. But the result is a stunning completion of a very important and cohesive vision. The book doesn't crackle with bleeding-edge novelty, but shines with the certainty of a job well-done.
Peter Wayner is the author of Translucent Databases , Disappearing Cryptography , and a number of other books. You can purchase Creating Applications with Mozilla from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
potential of mozilla development (Score:2, Interesting)
Re:potential of mozilla development (Score:4, Informative)
Re:potential of mozilla development - db's? (Score:4, Informative)
It's a little different if you are talking about accessing client-side data sources. Mozilla/XUL is (kind of) a virtual machine (VM), meaning it doesn't intrude too much upon the client's OS. But, XUL/XPCOM has bindings for all kinds of programming languages, such as C, C++, Perl, Python, Ruby, and the list keeps getting longer (Good intro here [ibm.com]). Thus, on the client-side you can use the database capability of any of these to talk to the Mozilla elements. I'm sure it wouldn't be too hard to whip up just a little communication between Mozilla and ODBC
Re:potential of mozilla development (Score:4, Interesting)
I really DO believe that Mozilla has a bright future in this regard. It provides some great tools. I about wet myself when I discovered the Javascript Debugger! As the article says, it will provide a totally free/Free way to deploy custom applications.
It's also a potent tool against IE's monopoly. If there's one thing that can cause people to switch from IE to Mozilla, it's applications that only work in Mozilla! I used to support the "Best Viewed with Any Browser" campaign (which is still appropriate for pure information) but I have since realized that because Mozilla is Free, open, and cross-platform, there is no need for anything else! I now encourage people to develop web-based applications in XUL.
I do have a few small gripes with it. Textboxes don't wrap like they do with HTML's "wrap=soft" attribute. That's bad. I asked in a newsgroup and was told that this functionality would be in Mozilla 1.2.
Also I was hoping to embed an HTML editor in my application, so that people could post HTML in their comments and have a fancy editor for them. To my dismay, it appears like the HTML Composer can ONLY be embedded in local chrome:// apps, not in those served by HTTP. Anyone know a way around this?
Overall though, Mozilla kicks arse! I think it has a very bright future!
XML is amazingly powerful (Score:5, Informative)
Furthermore, and of particular interest to someone like myself, the XML format offers a number of advantages for computational physics: clear markup of input data and results, standardized data formats, and easier exchange and archival stability of data.
I will definitely use a few dollars of grant money to purchase this book and keep it in the labs for all to read and enjoy.
the important part (Score:2, Insightful)
To me this is the one of the most important parts. I'm not a programmer, nor will I ever be I think. But from an evangelism perspective, I can point to this and say: "See, see? They were not just f-ing around for years, they were building something with amazing functionality!"
Lisp is just procedural?! (Score:3, Insightful)
Online book (Score:5, Informative)
Current Applications? (Score:1)
Re:Current Applications? (Score:4, Informative)
Re:Current Applications? (Score:4, Insightful)
In short anywhere which requires a web-oriented application (preferably cross-platform) would do very well to evaluate Mozilla as a development platform. I expect database and server-side apps will ship in due course with applications based on Mozilla to do form design and other administrative tasks in a cross-platform manner.
The real problem here (Score:4, Insightful)
This is why stuff like TCP/IP and "C" took off, because they were in the hands of a standards body who were responsible and considerate of issues like this.
The Gnu/Open Source community needs to take into consideration that since they are working their way into the mainstream they *must* begin to be more proffesional and intelligent in matters of "standards" or they risk alianating the commercial development community.
That would be a serious mistake on their end, serious indeed.
Warmest regards,
--Jack
Re:The real problem here (Score:5, Interesting)
The TCP/IP effort was very focused on standards and interoperability. That's what the U.S. Department of Defense, which funded the effort, wanted, because they wanted all their computers to be able to talk to each other. (Back then, IBM, DEC, Xerox, etc. each had their own network protocols, all incompatible.) The DoD project management people were very insistent on this; a formal DoD TCP/IP standard was pushed through. The individual implementations were forced to comply. (The Berkeley BSD crowd had to be hammered on a bit; they'd gone off on a LAN-only tangent for a while, neglecting long-haul issues.) And it worked.
C was the creation of two people. K&R C was rather PDP-11 oriented and lacked a real type system, but UNIX took off within the academic community before C was standardized. ANSI C came years later, so the UNIX world was still on K&R C years after the DOS world used ANSI C. Eventually, everybody settled down on ANSI C, but it took a while.
Re:The real problem here (Score:4, Informative)
Having said that, 99% of XUL is now solid anyway. If you develop apps, the syntax may change or more likely you'll get new features, but if you then want to upgrade to that version of Mozilla, you can simply run the old XUL through some XSL transforms. It's the same as with any API really, except it's easier to upgrade/alter XUL.
online version (Score:2, Redundant)
book [mozdev.org]
IWBEvent (Score:2, Funny)
I implemented IWBEvent for my app which uses the MSHTML control. There is a bug in IE which causes the OnUIActivate method to be called with an incorrect parameter.
Does Mozilla have an option to simulate this bug so that my app can be run without change on that platform?
Any questions for the author? (Score:5, Interesting)
Author giving talk tonight in TCD, Ireland (Score:3, Informative)
New Challenge (Score:1)
Komodo Mozilla based non browser application (Score:3, Informative)
ActiveState http://www.activestate.com (The Perl,Python,PHP,Tcl people) have a great IDE application written on the Mozilla engine called Komodo, it's up to version 2 now and certainly worth checking out.
Now if only ActiveState would just open source it, after all it's base is open.
XUL (Score:3, Informative)
it was rough in the begining since i had people that were not using mozilla and even now some people just use mozilla because they have to.
but the power of the lists, tabs, etc are awesome compared to having to write javascript/layers/etc crap that takes more effort than the cgi environment to code.
i love it
Gecko Runtime Environment (Score:2, Interesting)
One of the big updates being done for embedding purposes in the big 1.2 push is to get a basic installation prepared which can be used for all sorts of Gecko/Mozilla-based applications. See it coming to an application near you soon!
This is a very important development as it means that the full Mozilla suite will no longer need to be packaged with your custom application. The basic installation may even be installed on the system already - and can then be discovered and used by your system without installing a second copy!
This miraculous beast is the GRE, and its webpage is here [mozilla.org].
You need to "get it." (Score:5, Informative)
There are a couple of very interesting examples developed using this technology out already:
- OEOne [oeone.com], a complete desktop environment.
- Kimodo [activestate.com], a python and perl IDE.
I myself am working on a Bible program that will run, locally, under Mozilla. This is probably the future of desktop application development for most stuff.Cheapest yet? (Score:2)
Mozilla Development (Score:5, Informative)
I've been developing a Mozilla-based application component since August 2001. It's an HTML-rendering MOO client [www.moo.ca], and recently I've been pouring some 90% of my free time into working on it.
75% of that 90% of my free time lately has been updating the application to newer standards which have come into place since August 2001. For example, the Navigator/Mail/Editor/Chatzilla options used to be on the 'Tasks' menu in Mozilla, and were moved to the 'Window' menu around 1.0rc1. Bang, suddenly my application stops working properly, and less importantly, stops being a friendly component which works like all the others. A patch from a friend moved just about everything over to the 1.0rc1 way of doing things, and all was fine. Not everything worked flawlessly, though. The 'MOO Client' menu option didn't have an associated key visible, and the 'Window' menu inside MOOzilla didn't have any visible keys. The menus inside the application had long since stopped graying-out/disabling properly depending on what you have selected in the window. Many hours of last weekend was spent fixing these problems by conforming to new command handler expectations, and so on. (Where 'new' means 'changed since 0.9.6'. ;))
XUL is a wonderful tool. However, it runs dog slow on OS X. You don't have to take my word for it, just look at the Pheonix project. Pheonix is available for Windows and Linux, but not for OS X. Why? Because Chimera exists for OS X, which is faster (I'm using it right now) and integrates with the OS better. But... it doesn't support XUL. That's why it's faster. So where is my Mozilla application left? Stuck in the massive Mozilla suite when it's run in OS X. Mozilla, at startup, uses over 120 megs of RAM on my TiBook. Thank God for good VMs.
When initially writting MOOzilla, the XUL documentation was shit. The only place to go for any idea of how things really worked was deep inside the Mozilla source. And sure enough, this worked. The official XUL documentation at that time had sections which trailed off in 'blah blah blah' often because someone got bored of writting. I specifically remember it once read 'This is very important because blah blah blah'. Arrrg! How frustrating!
Mozilla is a powerful application development environment. XUL is a wonderful tool. Books like this one are going to make the world a better place for Mozilla component developers. And more cross-platform software developed with Mozilla makes the world a better place for users. Now... if only we can somehow apply this book heavily to the head of people who don't want to download Mozilla to try out an application, because they don't want to use it as a web browser. *sigh*.
God Damn It That's My Pot Pie Kitty! (Score:2, Interesting)
High Level Language is to make it easier and quicker to code. Remember doing "Hello World" in ASM? Then compared to when you wrote it in C? Where did that innovation go? I remember having to code 300 to a 1000 lines to accomplish what I was able to do in 10 lines in C. Also complexity was reduced in high level languages. Where did that mindset vanish.
Now I have some yahoo trying to tell me to use Mozilla as a front end to programs? Does using Mozilla some how make life easier for me? Quicker development times? Less errors? Let me think
NN NN OOOOOOOO !!
NNNN NN OO OO !!
NN NN NN OO OO !!
NN NNNN OO OO
NN NNN OOOOOOOO !!
So once again we have another programming FAD! Aww crap can I just get a good programming language...
Re:God Damn It That's My Pot Pie Kitty! (Score:4, Interesting)
Where the contention comes about is in how fat the client should be. IMO, most or all the functionality should be on the server, with the browser being Turing-dumb. (I drafted an XML protocol called SCGUI to do just this.)
However, some people and applications are going to want/need client-side scripting. If it gets to be too much client-side scripting, then you have essentially created a client-server application. That is probably what Mozilla should *not* target.
I guess what I am trying to say is that there is a need that Mozilla can fill and that I hope it does not get carried away in an Emacs-ish way.
That niche is an HTTP-friendly GUI browser with *optional* scripting capability to have *some* local Turing-complete application programmability sprinkled in. IOW, get right what HTTP+DOM+JavaScript could not get right.
But, if they make it a fat-client client-server tool, then slap them with a wet Visual Basic box.
NI! (Score:5, Funny)
And here I thought he was one of the knights who say "Ni!"
So it gets a 9, big suprise (Score:4, Insightful)
database applications (Score:4, Interesting)
The book is good and interesting, but it reminds me another book, Programming Jabber [oreilly.com]: a lot of examples in the book, and no available examples in real life (besides Jabberd itself).
Is anyone actually doing this? (Score:2)
But is the book any good????? (Score:2, Insightful)
This is NOT a book review (Score:4, Insightful)
The book itself *IS* good (at least that which I have read so far). You'd never be able to tell from this review though....
Data based GUI (Score:3, Interesting)
I laud Mozilla for going down this road and it is clear to me that the core developers for Mozilla are a step above your standard programmer. Some accuse Mozilla for not following a method that would create "standards" for their XML GUI description language, but I have found that the successful "standards" usually follow already adopted and reasonably mature technologies. You do not know how you want to design something until you have done it, used it, and given it to other people to play with. Only after an application has grown sufficiently to include all the thousands of unexpected details is it sufficiently mature for people to talk about standards. For example, I consider the EJB specification's largest failing is that they tried to standardize it before it was actively used for a couple of years. Only now that we have some mature app servers do we really have an idea what needs to be in the core EJB specification. If EJB had followed this road, maybe application developers would not need to use vendor specific code for the critical parts of the functionality. Like OO, the mantra of "standards" seems to be more of a marketing tool to get Fortune 500 companies to cough up millions of dollars than something that really influences how sophisticated and successful applications get developed.
I have my own questions for the Mozilla team. How do you deploy "overrides" of existing configurations. Suppose I want to deploy a "batch" of changes that I want to turn on or off. Is there a way to create configuration "layerings" in XML files so a group of data specifications can be conditionally included from a set of external files? How much scripting is allowed in these files? If I want to write conditional code for specifying a color (such as a color choice per day of the week), is there a way to write scripting solutions for that need? Of course, I could read the book but I am lazy and I suspect that it would not give a full answer.
What Many Commercial Developers Want ... (Score:3, Interesting)
How close is this Mozilla thing to supporting that?
Constructive criticism. (Score:3, Interesting)
I would like to relate a recent experience with NETSCAPE 7.0. Please excuse two paragraphs or so of background information...
But I digress... So back to *N*E*T*S*C*A*P*E* I installed Netscape for my mom, because Internet Explorer is trash. Netscape, in my opinion, is lacking in many areas (such as usability), but I'll classify it as software, rather than trash. So I installed it. The install went along pretty smoothly and before I knew it, I had Netscape launched. The new graphics are MUCH nicer than the extremely crappy ones in Communicator 4.x. But the initial screen was SOOOOOO cluttered!!! Buttons and tabs and side bars EVERYWHERE! As an experienced user of computers and web browsers, I couldn't hear myself think, so to speak, in all this optical noise. I immediately turned all that crap off and modified all the settings to my liking, so that my mother, who has much less experience than myself, would actually be able to use the damn thing. And then it happened. The next time I launched Netscape, everything locked up and the disk started crunching and grinding away like there was no tomorrow. Even the ctrl-alt-delete window took forever to show up. I ended up forcefully shutting off the power, because I couldn't even log out. (Yeah yeah... File a bug report--but do you HONESTLY think that my mother knows what a bug report IS, let alone knows how to file one?!!) And this is where the background information on XP comes in... I guess it REMEMBERS what made it crash and when you reboot it (or log out and log back in) it does it over again, consequently putting itself in the same situation and locking up again. That's what happened. Whenever I logged into my mother's account, the whole computer became so unresponsive (from the grinding and whatnot) that I couldn't even open up the huge, cumbersome Start menu. (Mafiasoft. Where do you want to pay today?)
I noticed that the other account, that I had originally set up for her out of the mere habit of always giving myself three or four accounts on my BSD boxen, still worked fine, so I logged into it, created yet another new account, moved all her files over, and deleted her original account. Oh yeah, and I removed Netscape and purchased a copy of the newest Opera 6.x for her. Sure, its initial screen is a bit cluttered and I have a few complaints about the increasing complexity and proliferation of seemingly unnecessary features (that other people probably want, just not me), but it's small, fast, and it WORKS. Extremely well, I might add. (It's what I am using right now under FreeBSD with Linux compatibility turned on.) Now she's happy as can be... And I know for a FACT that I will not buy a computer with Windows XP. And I am pretty disappointed with Netscape once again (not so much for the crash, but very much so because of the clutter), as I have been for several years. (Yes, I will continue trying it from time to time, because somewhere deep inside, I believe that it will BECOME a very good, reliable web browser. I just wish it'd become as SMALL as Opera (3 megs or so) and as fast. Netscape is very, very slow.)
I hope if any Netscape developers are reading this, that they'll take this as constructive criticism rather than as flamebait. Oh yeah. And YES, I know the Gecko engine is found in Galeon and several other browsers.
Re:Standards anyone ? (Score:2)
It isn't necessarily a web application. (Score:3, Insightful)
That being said I run mozilla on mac os 8, 9 & 10, linux, solaris and windows. I'm not sure what the problem would be.
Re:Standards anyone ? (Score:1, Offtopic)
Yes, it may cause a huge queue of people waiting to get first post when the timer runs down but this could be solved by adding a bit of randomness on a user level to the amount of time it would take to be allowed to post.
Re:Standards anyone ? (Score:5, Interesting)
This article is about the mozilla application framework. The application can be a stand alone application! This is not some kind of "mozilla only webpage."! This is just a method for creating an application that uses parts of the mozilla codebase, or more appropriately (though you and the mdos don't seem to understand the meaning of this) the mozilla application framework.
Re:Standards anyone ? (Score:3, Redundant)
Besides, Mozilla technology is available on most important platforms by now.
Re:Standards anyone ? (Score:4, Interesting)
It seems Mozilla is working closer and closer to being an OS than just a browser. Kinda funny if you think about it, where MS has windows which was supposed to be an OS and is now including a browser.
Re:Standards anyone ? (Score:5, Insightful)
What is doubly amusing is that when Microsoft attempted to kill (perhaps did kill) Netscape, they did so because they were scared the browser would turn into a platform that would let you write kickass apps making Windows irrelevant. In a way, this became a self-fulfilling prophecy, as if Netscape hadn't been taken over by AOL and left to do its own thing, would Mozilla (a platform as well as a browser) exist today?
I doubt that one day all desktop apps will be written using Mozilla. But it's an intriguing possibility, I look forward to the GRE with much interest.
Re:No, what's amusing... (Score:4, Informative)
All that IE does for Quicken is allow Quicken to use it as an HTML renderer. This is much different than Mozilla which can create a standalone application. The Quicken developers had to use C++ of VB or whatever and embed the MSHTML control into it. Mozilla does not require anything in addition to the package itself to create a new application. So even though this isn't necessarily new, it's definitely a lot more than IE can do on it's own. Plus you can embed Mozilla into apps like Quicken as well. Topstyle [bradsoft.com] does a great job of integrating IE and Mozilla side by side using this technology.
Re:Standards anyone ? (Score:5, Insightful)
Nope.
Can my IE web app run on almost every platform out there?
Nope.
Can I modify IE in case I need additional functionality?
Nope.
There's the tip of the iceberg in differences...