Java Database Best Practices 180
Java Database Best Practices | |
author | George Reese |
pages | 267 |
publisher | O'Reilly Associates |
rating | Excellent for Java programmers moving to J2EE |
reviewer | Erik Price |
ISBN | 0596005229 |
summary | A high-level introduction to writing database-driven apps in Java |
What it's about:
The book is divided into three sections of several chapters each:- Data Architecture - an introduction to database-driven application concepts
- Persistence Fundamentals - descriptions of the various persistence frameworks for Java application development
- Tutorials
The first section (Data Architecture) introduces some of the concepts that will be covered in greater depth later on in the book, but also contains an excellent chapter, "Relational Data Architecture," on database schema design and normalization. By the way, this is the sample chapter that can be downloaded from O'Reilly's site. In fact, this chapter set itself apart from the rest of the book in that it goes into a great deal of detail on its subject (although obviously an aspiring DBA should probably read whole books dedicated to the topic of relational database concepts). Most of the rest of the chapters in the book is somewhat more lightweight than "Relational Data Architecture." This section also contains a chapter that introduces some of the things to be aware of when managing transactions, including implementation tips on using transactions in JDBC programming such as optimistic locking and the various transaction types (dirty reads, etc).
The Persistence Models section focuses on different persistence frameworks, there is a chapter for each of the following: Persistence Fundamentals, EJB Container-Managed Persistence (covers 1.x and 2.0 models), EJB Bean-Managed Persistence, JDO, and "Alternative Persistence." The fundamentals chapter is where some of the best of the "best practices" of the book are found, and introduces such patterns as the Data Access Object pattern and the Memento pattern in the context of a simple guest book JSP application. The EJB chapters do assume that the reader has a basic understanding of how EJB works, and provides suggestions and guidance on ways to implement EJBs in real J2EE applications. (Don't worry, if you don't know about EJBs, the J2EE Tutorial chapter later in the book provides this.) The JDO section is one of the shortest in the book; I think that it's just such a new technology (in terms of available implementations) that most of the "best practices" are yet to be discovered. "Alternative Persistence" means Hibernate and Castor.
The Tutorials section is definitely not for advanced Java programmers, as it contains beginner-level introductions to the J2EE platform, the SQL language, the JDBC architecture, and the JDO API. If you really don't know anything about JNDI or servlets or EJB, then the J2EE chapter is written for you -- it's not a "how-to" tutorial, but rather a description of the basic concepts. The JDO tutorial is like the J2EE tutorial, introducing the basic concepts such as "the extent" and the filter language used to query for JDO-persisted objects, but I think partly because it's such a new technology, there's not a lot of detail here. You'll still have to read more about J2EE EJB, or JDO, if you decide to use them in a production application. On the other hand, you will learn how to make effective use of SQL queries and the JDBC API (which lets you execute SQL queries from your Java code) from their respective tutorials.
While this is a good start, you will eventually want something more in-depth than this if you are actually implementing a J2EE application (such as a book dedicated to servlet/JSP programming or Enterprise JavaBean development). But I really wish that I had read Java Database Best Practices before tackling these subjects, as it would have helped ease the transition
What's to like
As strange as it may sound, one of the things I liked most about the book is that it is relatively thin. In other words, the author gets right to the point and doesn't waste excessive space replicating information that can be found elsewhere. For instance, when describing how to implement a database-independent sequencing component, he incorporates enough code to support what he's saying, but doesn't include page after page of complete code listing, intact with multi-line Javadocs and plenty of whitespace -- just the meat. You can download all of the code from O'Reilly's site in a zip archive (and yes, it does include the Javadocs and whitespace that are wisely omitted from the book). Ironically, the book costs no less than other offerings from O'Reilly that are twice as thick.Also, the "best practices" in the book are very good and, at least in my case, I was not familiar with some of them, so it was very worthwhile reading. As an example, I myself have recently run into the problem of different sequencing systems on different databases (such as MySQL's AUTO_INCREMENT column type vs PostgreSQL's sequence types). I've worked around it by modifying the application's database calls, but that isn't really a good strategy. Implementing a sequencer at the application level (one of the "best practices") is a much better idea if you're not clustering your application servers and other applications will not be performing INSERTs into the database. On the other hand, if clustering is an issue, then it's probably a better idea to use EJBs, and if other applications will be writing to the data store, then database portability will be difficult in the first place (even with the help of Perl's DBI or PHP's PEAR DB abstraction). Some of the other excellent best practices introduced are the DAO pattern and database schema normalization coverage.
What's to consider
The most important thing to know when considering this book is that it really struck me as being appropriate for novice J2EE developers and/or those who are new to database programming in general. First of all, I think it's safe to assume that most people who will be doing anything with databases in Java will be using at least some element of the J2EE platform, and this book makes that same assumption. Java's tremendous success right now is in server-side application development. This means there won't be as much useful information in this book for the folks who are writing, say, an AWT interface tightly coupled to a MS-Access database through ODBC calls. Second of all, the patterns and practices described in this book should be familiar to most people who are already architecting J2EE applications, and are covered in greater depth in other books on enterprise application development.Having now covered the main consideration, I do have to pick a couple of nits. Firstly, this book does suffer from a few of the editing problems that plague nearly all computer books (yes even the O'Reilly books) in their first printing. It's kind of embarrassing, but even in the sample chapter I found a somewhat bizarre mistake near the end, where a class diagram is drawn up using ERD notation instead of UML. Fortunately, there aren't too many technical errors like this. Another bone to pick was the author's choice to use a hideous scriptlet-heavy JSP instead of a servlet forwarding to a JSP in the small Guest Book application in "Persistence Fundamentals." I know that this is Java Database Best Practices, not Java Model View Controller Best Practices, but scriptlets are both difficult to read and quite frankly scorned as J2EE moves toward JSTL and JSP 2.0. It's a little too bad that View and Controller are mixed up in this example, because the author does an excellent job of explaining how to implement the Model using the Data Access Object pattern.
Finally, I have a feeling this book was named "Java Database Best Practices" for marketing reasons, perhaps to go with O'Reilly's other offering, "Java Enterprise Best Practices". While this is an excellent book about Java database programming, and there are indeed dozens of "Best Practice" tips strewn throughout the book, I think a better name for this book would have been "Java Database Fundamentals."
The summary
I didn't want to simplify and rehash the book's "best practices" contents in this review, but rather provide prospective readers with an idea of what to expect from this book. Personally, I got a lot out of the book, but if you've already implemented bean-managed persistence in your EJBs using JDO, then you've probably already gotten past the point where this book is going to be a big help. In your case, it might be worth having around the office if you can get the company to pay for it. However, for those who have learned the Java language and want to get more involved in server-side application development, you're going to want to make sure you're familiar with all of these concepts and this book is the perfect way to get started with that.Where to find more info
I'm not going to replicate the table of contents or any of the content in the book, because all of that information as well as the excellent sample chapter are available from O'Reilly's site. I purchased the book from SoftPro Books in Massachusetts (US), a bookstore for computer geeks. This is a good place to peruse the book if you're still riding the fence.
You can purchase the Java Database Best Practices from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
Sounds like a winner... (Score:4, Interesting)
Let's all hop on the J-Band Wagon!
Re:Sounds like a winner... (Score:2)
Re:Sounds like a winner... (Score:5, Insightful)
Java, of course, is the best language because it was developed with an overall higher level of coolness. It has like this oneness with the world thing going on. C++ goes faster. Visual Basic and PHP are easier for beginnning programmers. Still, ti seems to me that relations within the data are the key to database integration happiness.
Object persistence (Score:3, Insightful)
I don't think it is possible to implement a decent persistence framework in C++ that doesn't rely on code generation. Java's reflection API is a big plus here.
I know it for sure because currently I'm working on a C++-based persistence layer -- after spending several months with OJB and Hibernate :)
Re:Sounds like a winner... (Score:2)
Yes, if you do a solid database design, and a solid program design which uses said database efficiently, in just about any language you can be as efficient as the database allows you to.
However, you'd be
SBCT??? (Score:2)
Well, my goal is to be perceived as a database programming guru. I already store XML in the data...but you bring up a good question: Exactly how do you change the color of the scroll bar...
I mean, if some young buck has a database that changes the color of the scroll bar, I know I am toast. Are there any good acronyms involved in the field of SBCT (ScollBar Changing Technologies)?
Re:Sounds like a winner... (Score:2)
Re:Sounds like a winner... (Score:2)
It went the way of BSD years ago.
ba-da-dum BANG
Re:Sounds like a winner... (Score:2)
Bad joke, I think I'm the only one who got it...
Re:Sounds like a winner... (Score:2)
I did have to use connection.supports to do a few tests at run
lacking (Score:1, Flamebait)
Don't use Java.
OK, I'll bite (Score:1, Troll)
In short, please try to think before you make rash claims about how lame Java is.
Re:a Troll? (Score:2)
Makes me hope to meta-mod this one, and makes me regret there isn't fair/unfair/stone dumb
Re:lacking (Score:2)
hmmm (Score:5, Funny)
"...I do not consider myself to be an expert on the subject."
Well then, you should fit in perfectly with the rest of the Slashbots!
Re:hmmm (Score:1, Funny)
Re:hmmm (Score:2, Interesting)
Transactions/Cursors (Score:5, Informative)
If your application really requires these things, you might want to get a database server that has direct support for them and write them as stored procedures. Straight SQL stored procedures can be very powerful, and can keep a lot of this messy logic where it belongs on the database server. Transactions should be short and simple as well.
Having a hanging transaction is one of a DBAs worst nightmares.
I think for the most part client/server applications are loosing ground to more of a three tier application scheme. In this case the cursor or the scrollable result set should be dumped, and instead just scroll through once and dump into a two dimensional array and access them this way. Grab and go.
n-tier applications (Score:3, Insightful)
Multi-tiered applications still require database code, database locking, and data sharing. While the client does not have access to a cursor or "scrollable result set", those features are still used at the back end where the system interfaces to the persistant storage (RDBMS.) Caching them as an array is only viable if the data is stable during your application's execution (lookups), or if your application is the only one accessing the database.
I agree that using application code to implement locking o
Re:n-tier applications (Score:2)
> if the data is stable during your
> application's execution
Or you can do an optimistic locking kind of thing... which takes a little more effort, but works well as long as everyone isn't updating the same row.
> products like PostgreSQL
+1. Postgres rocks.
In Java??? (Score:2)
In years of working with databases (mostly Oracle) I've yet to have a problem with Java, locking, and transaction control.
What can happen is you forget to close a connection - but that's just poor coding. Going though the relatively extreme agony of defining a bunch of stored procedures instead of making people using "finally()" for close statements just makes no sense - at least for Java. The JDBC API is very mature, and as someone e
Re:Transactions/Cursors (Score:2)
I can guess you come from the Sybase world. Come over to Oracle, my friend. Writers do not block readers, readers do not block writers, locks never escalate and deadlocks are automatically detected and resolved. Transactions can therefore be as complex as you want them to be, you can't hurt the database with a bad one.
Re:Transactions/Cursors (Score:2)
Re:Transactions/Cursors (Score:2)
Really? And just today i had to kill of an oracle process that was causing a deadlock....
stored procedures vs. Java application code (Score:2)
1. The syntax for stored procedures is awful. I always wondered where the hell they stole their syntax until I finally ran across some COBOL.
2. The compiler and runtime error checking are poor. The compiler generally stops at the first error it sees, and it does
If you think PL/SQL is bad try TSQL it's worse. (Score:2)
At least my CIO doesn't have his head up his ass like the rest of the C*Os do.
Re:Transactions/Cursors (Score:2)
Putting business logic into the database is a tarpit which will doom your application.
No unit testing, no way to organize your code into discrete files, no compiler to check the sanity of your entire codebase, no object oriented features (for MSSQL anyway), basically crappy SP languages. It goes on and on.
Having said that most non microsoft databases support java as an SP language and that mitigates a lot of my objections.
Rating? (Score:2)
Beats (Score:1)
Re:Beats (Score:2)
Nothing like plain old C code, with a sprinkling of E-SQL against Infomix SE and Vitamin C ansi libraries for UI handling, all run on SCO 3.2 (and 5.0.5)
All this to handle dog licenses and deeds for county clerks. Oh the fun!!
Thank you for making my ordinary day extraordinary! Bleh.
Skip this book. (Score:2, Funny)
Re:Skip this book. (Score:2)
Re:Skip this book. (Score:2)
Framemaker was originally developed on Unix.
Re:Skip this book. (Score:2)
Hmm..FrameMaker is the only program I remember using that rivaled TeX in the flexibility of page layout and quality of the output. Framemaker even accepts EPS for embedded graphics.
We should just be happy that O'Reilly chose a non-Microsoft application, because a Linux book written in Word, for example, would not only be hideous in appearance but leave OSS users seriously conflicted.
That's not irony! (Score:1)
See!
Sounds like it is missing... (Score:4, Interesting)
good information about one of the most important aspects of persistance in an object oriented language: Object Relational Mapping. I haven't read the book myself, but if it doesn't cover Java OR mapping layers such as Cocobase [thoughtinc.com], Toplink [oracle.com] and EOF (part of WebObjects) [apple.com], or any of the open source OR mapping frameworks, and the theoretical foundation they are all based on, then to me it isn't worth it.
Re:Sounds like it is missing... (Score:2)
ODBMS (Score:1, Funny)
Re:Sounds like it is missing... (Score:1)
Re:Sounds like it is missing... (Score:2, Informative)
Insightful Post (Score:3, Funny)
I was excited to read this title when I first noticed it listed on the Slashdot site soon after lunch. I downloaded and read the first couple paragraphs and waited expectantly for the material to seep through. I was hoping that this article would be perfect for me to post an insightful reply on as nearly all of morning, I have been feeling dull and stupid. though I am usually not so.
Anyway, I don't think it's working. I give up.
Ok here is a java question (Score:3, Interesting)
What platforms do you use for development?
What Dbs do you use?
What web server?
Why?
Inquiring minds want to check your java intake and output.
Re:Ok here is a java question (Score:1)
My teams do
What platforms do you use for development?
Windows
What Dbs do you use?
MSSQL
What web server?
Apache/Tomcat
Why?
Because all of our server side programs are written in Java. We deploy to both windows and Linux, Java has increased our productivity over C++, performance is on par with C++ for our systems (sometimes slower, sometimes faster), it means we have one technology for web and progra
Re:Ok here is a java question (Score:4, Interesting)
I would bet that nearly all the use of Java is for web-based apps that interface to a database.
What platforms do you use for development?
For Java, it would be J2SE from Sun (it includes JDBC).
What Dbs do you use?
Oracle, MySQL, PostgreSQL, DB2, etc.
What web server?
Apache, WebLogic, Sun ONE, etc.
These questions, at face value, mainly answer themselves. Perhaps a better question would be: what do Java programmers do to prevent database applications from turning into a quagmire of naive mistakes and bottlenecks making a well-intentioned application into a sick joke of engineering?
Database programming is one of those things that is simple enough, at first glance, to be attempted by every college sophomore on the planet, but complex enough, in reality, to make people who hired those college sophomores look foolish.
Re:Ok here is a java question (Score:2)
I swear that Universities get by with the cheapest renewable labor force possible. Class projects, computer programmer summer jobs at $6.50/hour, etc....
Unfortunately, it just ends up creating a pile of square wheels collecting dust somewhere, and the resulting experience graduates and moves out of state.
Re:Ok here is a java question (Score:5, Interesting)
Platform doesn't matter much. Linux, Win32, AIX, Solaris -- they've all got decent Java IDEs and JDKs.
Databases just need to be full-featured. Sybase, DB/2, Oracle, PostgreSQL -- I don't care as long as it's got a full feature set including sequencers, triggers, and stored procs (in that order of usefulness.)
Web servers are irrelevant to the back end development. The web server has hooks that redirect certain pages or page types to the "rich" environment of a J2EE or equivalent framework. Even Apache doesn't embed Tomcat, but cooperates with it to share the duties (let Apache do what it does best -- server up simple content, and let Tomcat/J2EE/JSP do what it does best -- serve up functionality with a corresponding performance hit.)
Transactions aren't a "feature" (Score:2)
Transaction commit and rollback are an integral part of databases. Without it, you've just got a keyed file structure, not a database.
I did, however, forget to mention integrity checking, which is even more useful than sequencers.
Re:Ok here is a java question (Score:1)
Re:Ok here is a java question (Score:2)
Try DB2, you'll be loving Oracle in no time.
Unless you can try a MySQL or PostGRES, I don't know much about either, but have heard good things about them both.
Re:Ok here is a java question (Score:2)
We're using Java mainly because we used it for a previous project and it worked well; switching to a different language, including evaluating, leaning, and determining good practices would not be worthwhile. We're using Oracle and Tomcat
Re:Ok here is a java question (Score:1)
Re:Ok here is a java question (Score:2)
Re:Ok here is a java question (Score:2)
JBuilder, and now increasingly Eclipse.
Oracle.
WebSphere.
Because that's what the company has bought.
Re:Ok here is a java question (Score:3, Interesting)
NetBeans hooked into a CVS server. It offers a huge amount of functionality (nearly competitive with JBuilder) and it is free.
Oracle 8i, although we're migrating to Oracle 9 fairly shortly. High-availability, clustering, and reliability. Oracle cannot be beaten.
Apache 2.0 in "worker" MPM mode. Multi-threaded, multi-process. Provides the stability of Apache 1.3 (multi-process so if one process crashes, no problem, t
Re:Ok here is a java question (Score:2)
Are you running Apache on Windows?
I'm not aware of any other platforms that gain much from multithreading. Though possibly NPTL on Linux will change that (but surely you aren't running the 2.5 kernel).
Re:Ok here is a java question (Score:2)
The problem with Apache 1.3 is that each connection requires a separate instance of the child process, which in turn takes up 2 megs (or so) of memory. Multiply that by 500 concurrent clients, and you see the bottleneck right there.
With 2.0 in MPM mode, each process (which we have configured to take 250 threads/children) takes up about 30-40 megs of memory. 500 concurrent clients takes up 80 megs of memory, as opposed to the 1 gig of memory with Apache 1.3.
So the issue isn't that multithread
Re:Ok here is a java question (Score:2)
Re:Ok here is a java question (Score:2)
Nope. Think about this-- say you have a page that is made up of:
- 1 JSP page
- 1 CSS file
- 1 JS file
- 7 images
90% of your content is static, and can therefore be served up by Apache. Even by limiting Resin's threads to 250 simultaneous, you can safely set Apache up to handle 2500 concurrent requests, realizing that 90% of tho
Re:Ok here is a java question (Score:1)
os/web server/application server/database
Linux/Apache/Oracle AS( piece of shit) / Oracle
NT/IIS/Tomcat/SQL Server
NT/IIS/Web Logic/SQL Server
Linux/Apache/Web Logic/Oracle
Solaris/Apache/Oracle AS/Oracle
Re:Ok here is a java question (Score:1)
Almost everyone.
What platforms do you use for development?
Eclipse, Websphere Studio Application Developer
What Dbs do you use?
SQL Server 2000
What web server?
Apache/Tomcat/JBoss
Why?
Because they're all any 2 of the following 3:
a) Free
b) Easy to use/configure
c) Powerful
Actually, Websphere is only (c), but meh...
Re:Ok here is a java question (Score:2)
ducks...
Re:Ok here is a java question (Score:2)
Re:Ok here is a java question (Score:2)
Re:Ok here is a java question (Score:2)
If all you're doing is XSL transformations, Weblogic shouldn't be any slower than Tomcat if you're using the same XSL parser. That said, I understand the memory/services overhead that Weblogic has. If you aren't doing EJB, Weblogic is serious overkill.
This may sound like a bad pitch/endorsement, but you may want to consider switching from Tomcat to Resin. Resin provides all the same functionality that Tomcat does, and is quite a
"Best Practices" (Score:1)
Re:"Best Practices" (Score:5, Interesting)
I have never quite figured out why some developers have a visceral negative reaction to the expression "best practices". In any field, a best practice is nothing more than a rule of thumb that guides your decision making. It is a heuristic.
Best practices cannot be fully incorporated into a language. Java does a good job of that, but new best practices grow from further use. As the reviewer noted, the chapters on newer technologies (e.g. JDO) were lighter in this book because programmers simply have not had as much experience in developing best practices with those technologies as with older ones (e.g. JDBC).
Furthermore, a best practice is not something you get sent to the electric chair for violating. When your decision violates a best practice, the "best practice" status simply indicates that you need to understand why it is a best practice and make sure you go to great lengths to justify its violation. On the other hand, you do not need to think a lot about sticking with a best practice.
By leveraging best practices, you simply gain a short-cut in decision-making. For those people who would say "short-cuts in decision making are bad", get real. Short cuts are necessary. You cannot analyze all possibilities resulting from every decision you make. Otherwise, you would never manage to flip a switch to turn on a light bulb.
Re:"Best Practices" (Score:2, Insightful)
I think a lot of us react negatively because Best Practices are often pushed by architect types that don't write code but they have all the Best Practice books and they use those to evaluate your output. In other words, they can be used as a crutch for the unknowledgable.
Also, there are the questions of "just who decided that these were the Best Practices anyway?" and "What exactly about them makes them Best?" Those are questions that aren't usually answered before th
Re:"Best Practices" (Score:1)
Also, a lot of these "best prctices" are pushed out by Sun's marketing well before any sort of performance is up to par.
And finally, if people were really capable of following "best practices" why the hell did Java have to be dumbed down to the lowest common denominator? If we assume people can code to "best practices" then Java would never have come about. That's its chief selling point, you ca
Re:"Best Practices" (Score:3, Insightful)
And best practices are always evolving. Many past best practices for Java are no longer best practices because Java has changed. Sometimes best practices help you get around a flaw in the underlying tool (like closing result sets and statements in JDBC code). Those best practices eventua
Re:"Best Practices" (Score:2)
Is there a language that does this perfectly? No. Few languages even try. Of those, IMHO, Java is the best at making the balance, even if imperfect.
Re:"Best Practices" (Score:2)
No, that is not why. It is simply a relatively new philosophy in language design. And it seems to work a hell of a lot better since it lowers the learning curve and empowers people to successfully build software that previously could not.
Java doesn't even have a goto FFS, how broken is that?
Not broken at all. There is no need for goto.
Re:"Best Practices" (Score:2)
Developers are allergic to the expression, not to the concept. Call it "design patterns" next time and you'll have them all worshipping at your feet.
Re:"Best Practices" by GR/smack.addict (Score:2, Funny)
Junior vs Experienced (Score:3, Insightful)
The junior and intermediate developers need "best practices" as a guideline while they learn. The experienced developer knows when to step out of the "best practices" to get performance and features that are needed by the application.
Think of it as driving a car. Most people will never need nor experience the handling of performance car -- the "best practices" of a normal powertrain and suspension are all they need. That doesn't mean there aren't people out there who will make good use of the extra fu
Re:Junior vs Experienced (Score:2)
Re:Junior vs Experienced (Score:1)
the only reason that someone today would write a list class in java or in c++ or any other oo language is that they _really_ need something specific or they don't understand the power of using tested code. it generall
Re:"Best Practices" (Score:1)
Because when language developers constrain the language to what they want users (application developers) to do, you wind up with something like dBase II; primitive, non-extensible, and extremely frustrating.
Clustering and Sequences (Score:5, Informative)
Actually, with some slight transactional modifications, it can be used in a clustered environment as designed. It was, in fact, originally designed to support a clustered pre-EJB application. I made the transaction support for the sake of this book simpler to illustrate the point.
The key to this scheme is that each application gets its own sequence key, so multiple applications or cluster nodes are free to generate unique IDs without duplication by other nodes or applications.
Application level sequencer == BAD (Score:5, Insightful)
I disagree. Why do you want to reimplement database features such as sequences when the developers of MySQL, PostgreSQL, Oracle, Sybase, etc. have spent plenty of time optimizing it. Ask Tom Kyte (of Oracle) his opinion about doing something like that -- here's his answer [oracle.com].
"But," you say, "that will mean making different versions of my code for each different database." Not exactly. Take a look at the implementation of Hibernate [sourceforge.net] which uses classes such as OracleDialect and MySQLDialect which are subclasses of Dialect. Each of these specific dialects implements vendor-specific code for sequences (and others). This allows the application level code to maintain its database independence while at the same time taking advantage of the vendor-specific features.
Doug
Re:Application level sequencer == BAD (Score:2)
Ask Tom Kyte (of Oracle) his opinion about doing something like that
In that article, Tom talks about a specific kind of application-level sequencer. The sequence he talks about is, in fact, a bad sequencer. When implementing an application-level sequencer, you must take into account the following:
Re:Application level sequencer == BAD (Score:2)
This provides application level sequences in a cluster and bypasses a lot of performance issues. Combined with my hierarchial storage model, it allows us to build out large complex trees of objects where the objects all know the primary keys of all of the objects as they will be if they get stored in the DB. The framework also allows us to ensure the
Persistence with XSL (Score:2)
I'm currently working on an article about an easy way to generate all the base classes you need for persistence. It's a lot of repetitative work to build that interface layer between SQL and target language.
The basic idea is that one converts SQL into XML, then applies and XSLT to generate all the base classes. I've applied this idea to three projects now, and I've gotten to where the autogenerator handles things like intersects properly.
So if you get it right in the XSL, one can change the SQL structure
Re:Persistence with XSL (Score:2)
To give you an idea, in NetBeans/SunONE/JBuilder/etc, you model your database (or import the schema from an existing JDBC connection) and then right-click on the table you're looking to create a bean for, select (something like) "Generate Classes" and poof, the IDE does all your work for you.
Re:Persistence with XSL (Score:2)
What do you recommend? (Score:1, Offtopic)
Re:What do you recommend? (Score:2)
Where's all the good stuff? (Score:2)
Daniel
Re:Where's all the good stuff? (Score:2)
Best practice???? (Score:2)
When you talk about best practice, you could at least mention the best of them all, esp with databases like Oracle, use of bindvariables.
The book gives examples in the form of:
select blah from tableblah where bleh='WHATEVER';
Everyone with some experience from an enterprise database knows the rule is: "Parse once, execute many times". By replacing 'WHATEVER' with
Re:Best practice???? (Score:2)
a) Not a best practice in database architecture, so inappropriate to call out as a best practice at that point
b) Too complex a concept to assume knowledge of at that point in the book
As a side note, I do call this out as a best practice in a later chapter and all subsequent chap
Re:Best practice???? (Score:2)
On the other hand, in simple SQL examples demonstrating join tables outside the context of any higher level programming language, the use of bind variables is completely inappropriate.
Though you may think I am not taking criticism well, I am simply pointing out that you and the previous poster are look
Why I hate the phrase (Score:2)
In my experience the only people who use such terms are mediocre Sales & Marketing managers who are supreme bullshitters and such phrases are the way they get this bullshit propogated. Then since they really do not have a clue about things like security, reliability, robustness, risk management, or engineering, nor real success at
Re:When is business speak going to die? (Score:2, Informative)
Re:When is business speak going to die? (Score:5, Funny)
Re:When is business speak going to die? (Score:3, Insightful)
This is true, but many IT departments don't have people with common sense, so this can still be a worthwhile investment. Better, say, than getting new hardware or software based on the IT departments own recommendations.
Tor
Best Practices in IT (Score:4, Insightful)
Reliability: I may be totally off base, but it seems to me that consistency is a factor in reliability. Assuring that things are written in a consistent manner generally involves defining best practices. I have seen many programs fail because a coder used inconsistent naming conventions.
Likewise Robustness seems to follow from having defined best practices.
Re:When is business speak going to die? (Score:2)
It does have a little meaning. Best practices are basically what a person would do after spending some time thinking about what would be an elegant way to solve a problem.
Best practices are not achieved after one 30-minute meeting. Nor are they achievable by design-by-committee. They require people on a team to be honest, first, and political, last.
Unfortunately, this rarely occurs in the real world, espe
HBUY Practices? (Score:3, Insightful)
HBUY (Haven't Blown Up Yet) Practices
WNRSWTW (We're Not Really Sure Why They Work) Practices
DSABAATO (Doesn't Suck As Bad As All The Others) Practices
I think the idea of "Best Practices" really does aim at security, reliability, and robustness. The idea is that someone/some group has found a set of methods that seems to work quite well in regard to these. So, let's use these as the baseline and improve from their instead of creating
Strict adherence to methodology (Score:2)
At my company we adhere to such a methodology and have delivered software that eventually compiled - every time.
With that, I'd like to introduce our unified methodology and propose that it be given proper respect thr
Re:Stored Proceedures (Score:1)
So really it is vendor-specific flavour you learn. For Oracle (PL/SQL) O'Reilly PL/SQL books are good.