Head First EJB: Passing the Sun Certified Business Component Developer Exam / Edition 1

Head First EJB: Passing the Sun Certified Business Component Developer Exam / Edition 1

4.0 2
by Kathy Sierra, Bert Bates
     
 

What do Ford Financial, IBM, and Victoria's Secret have in common? Enterprise JavaBeans (EJB). As the industry standard for platform-independent reusable business components, EJB has just become Sun Microsystem's latest developer certification. Whether you want to be certifiable or just want to learn the technology inside and out, Head First EJB will get you

See more details below

Overview

What do Ford Financial, IBM, and Victoria's Secret have in common? Enterprise JavaBeans (EJB). As the industry standard for platform-independent reusable business components, EJB has just become Sun Microsystem's latest developer certification. Whether you want to be certifiable or just want to learn the technology inside and out, Head First EJB will get you there in the least painful way. And with the greatest understanding.You'll learn not just what the technology is, but more importantly, why it is, and what it is and isn't good for. You'll learn tricks and tips for EJB development, along with tricks and tips for passing this latest, very challenging Sun Certified Business Component Developer (SCBCD) exam. You'll learn how to think like a server. You'll learn how to think like a bean. And because this is a Head First book, you'll learn how to think about thinking.Co-author Kathy Sierra was one of Sun's first employees to teach brave, early adopter customers how to use EJB. She has the scars. But besides dragging you deep into EJB technology, Kathy and Bert will see you through your certification exam, if you decide to go for it. And nobody knows the certification like they do - they're co-developers of Sun's actual exam!As the second book in the Head First series, Head First EJB follows up the number one best-selling Java book in the US, Head First Java. Find out why reviewers are calling it a revolution in learning tough technical topics, and why Sun Chairman and CEO Scott McNealy says, "Java technology is everywhere...if you develop software and haven't learned Java, it's definitely time to dive in "Head First."And with Head First book, you don't even have to feel guilty about having fun while you're learning; it's all part of the learning theory. If the latest research in cognitive science, education, and neurobiology suggested that boring, dry, and excruciatingly painful was the best way to learn, we'd have done it. Thankfully, it's been shown that your brain has a sense of style, a sense of humour, and a darn good sense of what it likes and dislikes.In Head First EJB, you'll learn all about:

  • Component-based and role-based development
  • The architecture of EJB, distributed programming with RMI
  • Developing and Deploying an EJB application
  • The Client View of a Session and Entity bean
  • The Session Bean Lifecycle and Component Contract
  • The Entity bean Lifecycle and Component Contract
  • Container-managed Persistence (CMP)
  • Container-managed Relationships (CMR)
  • EJB-QL
  • Transactions
  • Security
  • EJB Exceptions
  • The Deployment Descriptor
  • The Enterprise Bean Environment in JNDI
  • Programming Restrictions and Portability
The book includes over 200 mock exam questions that match the tone, style, difficulty, and topics on the real SCBCD exam. See why Kathy and Bert are responsible for thousands of successful exam-passers—"The Sun certification exam was certainly no walk in the park, but Kathy's material allowed me to not only pass the exam, but Ace it!"—Mary Whetsel, Sr. Technology Specialist, Application Strategy and Integration, The St. Paul Companies"Kathy Sierra and Bert Bates are two of the few people in the world who can make complicated things seem damn simple, and as if that isn't enough, they can make boring things seem interesting."—Paul Wheaton, The Trail Boss, javaranch.com"Who better to write a Java study guide than Kathy Sierra, reigning queen of Java instruction? Kathy Sierra has done it again. Here is a study guide that almost guarantees you a certification!"—James Cubetta, Systems Engineer, SGI

Read More

Product Details

ISBN-13:
9780596005719
Publisher:
O'Reilly Media, Incorporated
Publication date:
10/28/2003
Series:
Head First Series
Edition description:
New Edition
Pages:
734
Sales rank:
752,682
Product dimensions:
8.00(w) x 9.25(h) x 1.52(d)

Table of Contents

;
Advance praise for Head First EJB™;
Praise for the Head First approach and Head First Java™;
Praise for the Head First approach;
Perpetrators of the Head First series (and this book);
How to Use This Book: Intro;
Who is this book for?;
We know what you’re thinking;
And we know what your brain is thinking;
Metacognition: thinking about thinking;
Here’s what WE did;
Here’s what YOU can do to bend your brain into submission;
What you need for this book;
Last-minute things you need to know;
About the SCBCD exam;
Technical Reviewers;
Other people to credit:;
Chapter 1: Intro to EJB: Welcome to EJB;
1.1 What is EJB all about?;
1.2 What does EJB really give me?;
1.3 No more vendor lock-in!;
1.4 How does it all work?;
1.5 Behind the scenes...;
1.6 Beans come in three flavors;
1.7 Session beans can be stateless or stateful;
1.8 Example: The Advice Guy bean;
1.9 Five things you do to build a bean:;
1.10 EJB Roles and Responsibilities;
1.11 Tutorial:;
1.12 Organize your project directory;
1.13 Compile the two interfaces and the bean class;
1.14 Start the server;
1.15 You’ll see something like this;
1.16 Start deploytool;
1.17 you’ll see something like this;
1.18 Make a new Application;
1.19 Name and save the new application;
1.20 What you’ll see after you create and name the application;
1.21 Now let’s make the new enterprise bean (the ejb-jar and the DD);
1.22 Now we’re in the really cool New Enterprise Bean Wizard;
1.23 Create the new ejb-jar;
1.24 Add the three class files (including their package directory) to the JAR;
1.25 Confirm that you added ONLY the package directory and the class files;
1.26 Make it a Stateless Session bean;
1.27 Tell it which of the three class files in the JAR is the actual BEAN class;
1.28 Tell it which is the Home interface, and which is the Component interface;
1.29 Verify everything on this screen!;
1.30 You’re done, click Finish;
1.31 Meanwhile back on the main deploytool screen...;
1.32 Run your bean through the deploytool verifier;
1.33 Close your eyes and click OK;
1.34 Whew! No failed tests;
1.35 Time to Deploy;
1.36 Make it Return a Client Jar;
1.37 Give it a name, so clients can look it Up;
1.38 Watch the progress bars go up, then celebrate;
1.39 Now you’ll see the AdviceApp inside the server;
1.40 Now all we need is a client...;
1.41 Organizing your project directory for the client;
1.42 Coffee Cram: Mock Exam;
1.43 Coffee Cram: Mock Exam Answers;
Chapter 2: Architectural Overview: EJB Architecture;
2.1 You remember this picture...;
2.2 Making a remote method call;
2.3 There’s a “helper” on the server as well...;
2.4 What about arguments and return values?;
2.5 What really gets passed when you pass an object to a remote method?;
2.6 Passing a Remote object through a remote method call;
2.7 What must the Remote object and the stub have in common?;
2.8 The client calls business methods on the stub through the Remote business interface;
2.9 How EJB uses RMI;
2.10 The Remote object is not the bean, it’s the bean’s bodyguard—the EJBObject;
2.11 The Component interface;
2.12 Who writes the class that really DOES implement the component interface? In other words, who makes the EJBObject class?;
2.13 Who creates what?;
2.14 The bean Home;
2.15 Architectural overview: Session beans;
2.16 Architectural overview: Entity beans;
2.17 Architectural overview: Creating a Stateful Session bean;
2.18 Architectural overview: Creating a Stateless Session bean;
2.19 Who creates the stateless session bean, and when?;
2.20 Stateless session beans are more scalable;
2.21 Architectural overview: Message-driven beans;
Chapter 3: The Client View: Exposing Yourself;
3.1 What the client really wants;
3.2 It all starts with the home interface;
3.3 How a client uses a session bean: create, use, and remove;
3.4 But first, we have to get a home interface reference;
3.5 Let’s take another look at the complete client code;
3.6 Just when you thought a simple cast would be enough...;
3.7 But NO. You have to narrow the object as well!;
3.8 OK, I’ll bite. Why can’t you just do a plain old cast?;
3.9 PortableRemoteObject.narrow();
3.10 Writing the Remote home interface for a session bean;
3.11 Remote home interface examples for session beans;
3.12 But enough about the home... let’s talk about the EJB object. The component interface. The thing you REALLY want.;
3.13 Imagine what else you might want to do with your EJB object reference...;
3.14 Thankfully, we’ve got handles;
3.15 isIdentical?;
3.16 A bean’s client interfaces can be local;
3.17 Which methods make sense for the local client interfaces?;
3.18 When you think handle, think Remote;
3.19 Who needs EJBMetaData when you’ve got reflection?;
3.20 Do you need isIdentical() when there’s equals()?;
3.21 Why so many remove methods?;
3.22 Comparing Remote vs. Local interfaces;
3.23 Writing the local client interfaces;
3.24 You can have both a Remote and local client view for a bean, but you probably won’t.;
3.25 Exceptions in client interfaces: what the client might get;
3.26 Local client code;
3.27 What has to change inside the bean class?;
3.28 Arguments to Remote vs. local methods;
3.29 Coffee Cram: Mock Exam;
3.30 Coffee Cram: Mock Exam Answers;
Chapter 4: Session Bean Lifecycle: Being a Session Bean;
4.1 Exploring the session bean lifecycle;
4.2 You remember how it all works, right?;
4.3 There’s obviously more to the bean’s lifecycle than just creation and business methods...;
4.4 Container Callbacks, for the special moments in a bean’s life...;
4.5 Container Callbacks come from TWO places;
4.6 Implementing the container callbacks;
4.7 We have to look at the transitions;
4.8 Bean Creation: when an object becomes a bean;
4.9 Bean things you can do during creation;
4.10 Bean Use: what happens AFTER creation...;
4.11 Bean things you can do within business methods;
4.12 Passivation: a stateful bean’s chance at scalability...;
4.13 Your job for passivation: make your state passivatable!;
4.14 Bean things you can do in ejbActivate() and ejbPassivate();
4.15 Bean Removal: when beans die;
4.16 Complaints about bean removal;
4.17 Bean things you can do in ejbRemove();
4.18 Implementing the AdviceBean as a stateFUL bean;
4.19 AdviceStatefulBean code;
4.20 AdviceStatefulBean CLIENT code;
4.21 Deploying a stateful bean;
4.22 Compared to stateful beans, stateless beans have a simple life;
4.23 Bean things you can do from stateless bean methods;
4.24 Writing a Session Bean: your job as Bean Provider;
4.25 SessionContext;
4.26 Coffee Cram: Mock Exam;
4.27 Coffee Cram: Mock Exam Answers;
Chapter 5: Entity Bean Intro: Entities are Persistent;
5.1 What’s an entity bean?;
5.2 Entities vs. Entity Beans;
5.3 Entity beans from the client’s point of view;
5.4 A very simple Customer entity bean;
5.5 An entity bean’s client view;
5.6 Entity bean Remote component interface;
5.7 Entity bean Remote component interface;
5.8 Entity bean Remote home interface;
5.9 What does the client really want from an entity bean home?;
5.10 Entity bean Remote home interface;
5.11 When finders have a dark side...;
5.12 Home business methods to the rescue;
5.13 Session bean create() vs. entity bean create();
5.14 Session bean remove() vs. entity bean remove();
5.15 Entity/bean/instance death;
5.16 Entity bean client view;
5.17 Coffee Cram: Mock Exam;
5.18 Coffee Cram: Mock Exam Answers;
Chapter 6: Bean/Entity Synchronization: Being an Entity Bean;
6.1 The real power of entity beans is synchronization;
6.2 The only question is WHO does the work when it’s time to synchronize;
6.3 Container-managed vs. bean-managed persistence;
6.4 A brief history on the evolution of CMP 2.0;
6.5 The EntityBean interface adds three new container callbacks (including two just for synchronization);
6.6 Even the methods that are the same, don’t behave the same;
6.7 But wait... there’s more! Entity beans have new home container callbacks, too;
6.8 Writing a CMP entity bean: make it abstract;
6.9 You put three kinds of things in your bean class:;
6.10 PLUS... (ok, that’s four things...);
6.11 Virtual fields are NOT instance variables!;
6.12 Complete code for the CustomerBeanCMP class;
6.13 So how DID the client get a reference to the EJB object for #28?;
6.14 Bean things you can do during entity construction:;
6.15 Object identity: the primary key;
6.16 Bean things you can do during entity creation:;
6.17 Bean things you can do in home business methods;
6.18 Bean things you can do during activation and loading;
6.19 Bean things you can do during passivation and storing;
6.20 Coffee Cram: Mock Exam;
6.21 Coffee Cram: Mock Exam Answers;
Chapter 7: Entity Relationships: When Beans Relate;
7.1 Beanifying your movie database;
7.2 But we don’t want to think in TABLES We want to think in CLASSES;
7.3 We need relationships between the Movie bean and the Director bean;
7.4 Why should the Director be a bean? Why can’t it just be data?;
7.5 Relationships and multiplicity;
7.6 Multiplicity in Bean Classes;
7.7 Multiplicity affects return type!;
7.8 Defining virtual fields for persistent data fields and relationship fields;
7.9 Defining your “abstract persistence schema” (virtual fields aren’t enough);
7.10 Persistent CMP fields in the DD;
7.11 Using relationships in your code;
7.12 Defining relationships in your abstract persistence schema (in the DD);
7.13 Mapping from abstract schema to a real database;
7.14 Coffee Cram: Mock Exam;
7.15 Coffee Cram: Mock Exam Answers;
Chapter 8: Message-Driven Beans: Getting the Message;
8.1 Imagine this scenario...;
8.2 Too bad these guys aren’t message-driven beans;
8.3 Message-driven bean class;
8.4 Writing a message-driven bean: your job as Bean Provider;
8.5 Notice something missing from the code?;
8.6 Topics and Queues;
8.7 Only ONE bean per pool gets a copy of a topic message;
8.8 With a queue, only one bean gets the message. Period.;
8.9 MessageDrivenContext;
8.10 MessageDrivenContext;
8.11 What if something goes wrong?;
8.12 Message acknowledgement;
8.13 That’s all well and good, but let’s go back and see how our earlier scenario ended...;
8.14 Think about it.;
8.15 Coffee Cram: Mock Exam;
8.16 Coffee Cram: Mock Exam Answers;
Chapter 9: EJB Transactions: The Atomic Age;
9.1 The ACID test;
9.2 Distributed transactions: two-phase commit;
9.3 How it works in EJB;
9.4 Some transactions don’t propagate;
9.5 How do I make (or get) a transaction?;
9.6 Transaction-related methods are in two interfaces;
9.7 Making a BMT transaction;
9.8 Call stack of the checkOut() method;
9.9 Things you must NOT do with BMT;
9.10 What does it mean to suspend a transaction?;
9.11 The UserTransaction interface;
9.12 setRollbackOnly();
9.13 setRollbackOnly() lives in TWO interfaces;
9.14 getRollbackOnly();
9.15 BMT beans use getStatus() instead of getRollbackOnly();
9.16 BMT can be a really BAD idea. BMT hurts bean reuse;
9.17 Container-managed transactions;
9.18 How attributes work;
9.19 Transaction attributes that require a transaction;
9.20 Transaction attributes that do not require a transaction;
9.21 These are the methods you MUST mark with an attribute (for a CMT bean);
9.22 “Unspecified Transaction Context”;
9.23 Burn these in;
9.24 Marking transactions in the DD;
9.25 DD example for CMT;
9.26 More DD examples for CMT;
9.27 Summary of Bean-managed demarcation;
9.28 Entity beans have ejbLoad() to stay synchronized, even if the transaction rolls back.;
9.29 Session Synchronization;
9.30 SessionSynchronization “special moments”;
9.31 Coffee Cram: Mock Exam;
9.32 Coffee Cram: Mock Exam Answers;
Chapter 10: Exceptions in EJB: When beans go bad;
10.1 What can go wrong?;
10.2 Remember, Java exceptions can be checked or unchecked;
10.3 It’s all about expectations...;
10.4 In EJB, exceptions come in two flavors: application and system;
10.5 With an Application Exception, the Container will...;
10.6 With a System Exception, the Container will...;
10.7 Warning! RemoteException is checked, but not expected!;
10.8 RemoteException goes to remote clients EJBException goes to local clients;
10.9 Bean Provider’s responsibilities;
10.10 The Container’s responsibilities;
10.11 The five standard EJB application exceptions;
10.12 The five standard application exceptions from the client’s point of view;
10.13 Common system exceptions;
10.14 Common system exceptions;
10.15 Scenarios: what do you think happens?;
10.16 Scenario Summary;
10.17 Coffee Cram: Mock Exam;
10.18 Coffee Cram: Mock Exam Answers;
Chapter 11: Security in EJB: Protect Your Secrets;
11.1 Imagine you’re writing a payroll application...;
11.2 What can you do?;
11.3 How to do security in EJB;
11.4 The Application Assembler’s job: access control;
11.5 Defining the roles;
11.6 Defining the roles... a better way;
11.7 Defining the method permissions;
11.8 Defining the method permissions;
11.9 Method permissions interact with one another as a union!;
11.10 Watch out for </unchecked>;
11.11 The Deployer’s job: mapping actual humans to abstract roles;
11.12 Principals and Roles, Users and Groups;
11.13 Class-level vs. instance-level security;
11.14 Using programmatic security to custom-tailor a method;
11.15 The problem with isCallerInRole()...;
11.16 Map declarative security roles to the programmer’s hard-coded (fake) roles;
11.17 Use <run-as> security identity to pretend someone else is calling...;
11.18 Security context propagation with <run-as>;
11.19 Coffee Cram: Mock Exam;
11.20 Coffee Cram: Mock Exam Answers;
Chapter 12: A Bean’s Environment: The Joy of Deployment;
12.1 A bean’s special place- java:comp/env;
12.2 But it’s not per bean instance... It’s per bean home;
12.3 It’s simple... if the programmer puts a made-up JNDI name in code, he has to announce that to the deployer in the DD.;
12.4 Bean Provider and Application Assembler responsibility for the Deployment Descriptor;
12.5 Deployer responsibility for the Deployment Descriptor;
12.6 Remembering who does what;
12.7 Now let’s look at the bean’s runtime environment;
12.8 Which APIs does EJB 2.0 guarantee?;
12.9 What MUST be in an ejb-jar?;
12.10 Structure of an ejb-jar;
12.11 Programming restrictions;
12.12 Coffee Cram: Mock Exam;
12.13 Coffee Cram: Mock Exam Answers;
Final Mock Exam;
Coffee Cram;
Coffee Cram: Master Mock Exam;
Coffee Cram: Master Mock Exam Answers;
This isn’t goodbye;
Cover Rough Drafts for the series;
Interface summary;

Read More

Customer Reviews

Average Review:

Write a Review

and post it to your social network

     

Most Helpful Customer Reviews

See all customer reviews >