In order to seek new progress, I think I started learning EJB programming from today.
I hope that all kind-of-minded friends can participate in it.
I am using the reference book is the Wrox EJB Programming Guide. This book has more than 1,000 pages, and strive to complete him all!
Ok, I don't have to say it. Now start to enter the first chapter.
Chapter 1 Enterprise JavaBeans System.
A large stack of nonsense will begin, and the multi-layer architecture is told from the single-layer architecture, and the N-layer architecture is said. This leads out the subject (J2EE). But this sentence is good: Others need special attention () server resources including threads, database connections, security, transactions, and more. Customization of the infrastructure of these resources is quite hard. This work is impossible in the Internet environment. If your development cycle is only three months, is it possible to establish a connection pool, an object buffer or a "wonderful" object layer for database access?
gosh! Said a big pile, finally got a great J2EE. But if you don't know the N-layer structure, you should look!
Container: It is said that the container is the operating environment of the Java program. I don't know if my understanding is correct. Now, you can only understand this.
The book says that the J2EE specification defines four container types:
1. Applets.
2. Application customer container. (I think it is swing)
3. Web container (Servlet and JSP)
4. EJB container.
It seems that 123 have been mastered, and now it is 4, so the EJB container is still learning! ~
The book writes a more in-depth explanation on EJB: EJB is a distributed component model that develops secure, scalable, transactional multi-user components. Simply put, EJB is a reusable software unit that contains business logic. As JSP can separate the application with business logic, EJB can separate application logic and system layer services, enabling developers to consider business issues without having to consider system programming.
J2EE API:
RMI / IIOP: Remote Method Invocation Some things like network connections.
JAVA Naming and Directory Interface.
JDBC: Don't you say this?
JavaMail / Jaf: Java's Mail service, JAF is an accessory for mail.
JMS: Java Message Server. Java message service.
Why use EJB in the design: I said a lot, I am still uncertain. Go again!
However, this time I am more determined, the original EJB container is equivalent to a "function" server, and some business functions can be written. Then use 123 to call! (I don't know if it is a bit funny).
Haha, my understanding is correct, I said the 8th page of the book, the container can be seen as an executive environment!
EJB container service: (The container service here is not encoded, but the container management you are implemented. Good)
Component pool and life cycle management:
Haha, come to the vernacular, this is my personal understanding, the component pool has generated a lot of bean instances when the container starts, if it is 10, this time the customer 1 is coming, he took Bei1 At this time, others can't use bean1, and then come back to the second customer. He can't take Bean1, you can only take bean2. . . . . . . At this time, the customer 11 came, the container found no bean used him, so I found a bean who now used to use it, but I found that all are occupied, there is no way, I have to regenerate it into him. . Haha, it is so simple, but someone will ask, is this not more to build? It doesn't matter, the container finds that the generated bean is not used, it will be automatically deleted, release the space, release the system resources! Customer session management:
Understand the passivation and activation.
Passivation is to save the customer's BEAN state in the pool.
Activation is to give the customer's bean status to the customer.
Database connection pool:
This seems to be not to talk! Data resource sharing! This named COOL B is.
Transaction management:
The transaction is very expensive!
Verification and access control:
This is very simple!
How to provide services in containers: This part is not written first, then write again, because I don't understand. Haha
EJB Type: ***** This is a key place. *****
Divided into three types:
Session bean: (life is as long as the conversation of our customers)
1. No state session bean.
2. Status Session Bean.
These two beans are very important, but they are told in Chapter 3. Haha, take this!
Entity Bean:
I understand that it is a database bean, just read the contents of the database in Bean, and I don't know how it is read. Don't be very wasting system resources! ? ? ?
The entity bean can be divided into:
CMP (persistence of container management): The container is responsible for the BEAN and the foundation database synchronization.
BMP (persistence of bean management): Here you must program a person responsibility and basic database synchronization! The container calls the programmer to write a good SQL statement when appropriate!
I really don't understand why CMP has I have to have a BMP, and the book is explained:
Sometimes adding design flexibility or support persistence in non-relational storage? ? Is this a human language?
There is also a bit: EJB specification V1.1 allows only one-to-one mapping between instance variables and table columns. Thus, when using this version, if you want to indicate a cumulative object in a plurality of tables in the entity bean, CMP cannot be used, and BMP is used. EJB2.0 specification fixes complex query language! Still very well! ~~~~ But it should be useful! ! I will find it in the future! Ha ha! ~~
Message driver bean. Chapter 6: just wait! Brothers ~~~~
Haha! After reading the first chapter. Look at Chapter 2 tomorrow!