Enterprise web programming

Modules ENTWA (Level 6) and APSW (Level 7)

Quiz

The following questions are for you to test your own knowledge of the concepts and terminology used in Java web programming. I won't be providing the answers - you need to look them up. I am however to discuss any that you still don't understand after you've looked them up.

Web in general

You should already know the answers to these questions before the unit starts.

  1. Explain what an HTTP request is.
  2. How does an HTTP request travel over a network?
  3. Explain what an HTTP response is and its relationship to a request.
  4. Explain what HTTP status codes such as 200 and 404 mean.
  5. What is a mime type and what is its relationship to HTTP messages?
  6. Why in the WWW might there be more HTTP requests than HTTP responses?

Web programming in general

ENTWA students should already know the answers to these questions before the unit starts. APSW students should know within the first week or two of the unit.

  1. What is the difference between a static web page and a dynamic one?
  2. How does the content of a dynamic web page get created?
  3. What are the four architectures for dynamic web applications?
  4. Why is the architecture that Java uses the most scalable?
  5. Why is the architecture that Java uses the most resilient?
  6. How can you use Java's architecture to provide an enterprise web application on a global scale?

Java web programming basics

You should know the answers to these questions within the first week or two of the unit.

  1. What is a servlet?
  2. What is a JSP?
  3. What is the relationship between a JSP and a servlet?
  4. What advantages does Java's servlet programming model have over (a) CGI? (b) PHP?
  5. What do we mean when we say that a request is forwarded from one servlet to another?

Java language basics

You should either know the answers to these questions before the unit starts, or you need to find them out for yourself fairly quickly.

  1. What is an exception and what is one used for?
  2. Explain throwing and catching exceptions.
  3. What do we mean when we say that one class inherits from another?
  4. If an application had classes Person, StaffMember and Student, how might they be related?
  5. java.util and jim.sums.entities are examples of what?
  6. What is the difference between a field that is private, protected or public?
  7. What does static mean when associated with a class's fields or methods?
  8. Explain what the classes/interfaces Collection, Set, List, ArrayList and Vector represent and what are the distinctions between them?
  9. What is a Map?
  10. What does the declaration Map<String, Person> represent?

JSF specifics

You should know the answers to these questions within 2-3 weeks of the topic being introduced in lectures.

  1. What is a facelet?
  2. What is a backing bean?
  3. What is meant by the scope of a backing bean?
  4. What are the available scopes to choose from?
  5. Which scope is the default?
  6. Draw the JSF lifecycle.
  7. Give at least 10 examples of how different HTML controls can be represented using facelet tags.
  8. What do the properties of a backing bean represent?
  9. What notation is used in a facelet to associate a property or method with a control?
  10. Why is JSF superior to JSP?

EJB specifics

You should know the answers to these questions within 2-3 weeks of the topic being introduced in lectures.

  1. What are the 3 types of session bean?
  2. In what circumstances would you use each of the 3 types?
  3. Which of the 3 types is most commonly used?
  4. What is the difference between a session bean and a message bean?
  5. What is dependency injection?
  6. Who or what does the injecting?
  7. What annotation is normally used for dependency injection?
  8. How would you specify the start and end of a transaction in a stateful EJB?

More advanced EJB questions

You will need to know the answers to these questions to be considered a first-class student.

  1. What annotations can be used to control what happens when an EJB is created or destroyed?
  2. What is the timer service used for?
  3. What is the difference between a local interface, a remote interface and a no-interface view?
  4. What do we mean by pooling beans?

JPA specifics

You should know the answers to these questions within 2-3 weeks of the topic being introduced in lectures.

Entity beans

  1. What is an entity bean?
  2. How do you make a bean an entity bean?
  3. What does the @Id annotation do?
  4. What annotation is used to denote a composite primary key?
  5. Under what particular circumstances would you have to use the @Column and/or @Table annotations?
  6. What annotations are used to specify the cardinality of a relationship between two entity types?
  7. Explain what is meant by a unidirectional relationship and a bidirectional relationship?
  8. How do you tell JPA where to store the data that makes up a foreign key? [Be careful!]
  9. What do the terms eager and lazy mean in this context?
  10. Which relationships are by default eager, and which are by default lazy?
  11. What strategies are available for mapping inheritence relationships in JPA?
  12. What are the annotations used to specify the chosen inheritence strategy? Where must those annotations be placed?
  13. How do you get JPA to arrange your lists in the right order?

Entity management

  1. What is an entity manager?
  2. What is an entity manager factory?
  3. What is the difference between container-managed environment and a non-container-managed environment?
  4. How do you obtain an entity manager when operating in each environment?
  5. What do we mean when we say that an entity is detached?
  6. Draw an entity lifecycle diagram showing all possible transitions between states.
  7. How do you stipulate that an entity should be (a) managed? (b) deleted? (c) merged/reattached? (d) found by its primary key?
  8. What is JPQL?
  9. Why is JPQL useful?
  10. What major effort does JPQL save in comparison with SQL?
  11. What is a named query and what is it useful for?
  12. What is a data access object used for?
  13. What is a persistence unit and where are its details usually to be found?
  14. What is the relationship between a persistence unit and an entity manager?
  15. What is the difference between optimistic and pessimistic transaction locking? Which do we normally use? Why is optimistic locking "optimistic"?
  16. What is the JPA implementation that we use called? What other implementations are there?

More advanced JPA questions

You will need to know the answers to these questions to be considered a first-class student.

  1. What are the pros and cons of using JPQL queries and criteria queries?
  2. Why is using a named query often more efficient than a JPQL query?
  3. What is a native query?
  4. How do you do bulk operations in JPA?
  5. What does it mean when we talk about cascading events in this context?
  6. How does versioning of entities work? Why is it useful?
  7. In the context of JPA, describe what EclipseLink, TopLink and Hibernate are.

Security specifics

You should know the answers to these questions within 2-3 weeks of the topic being introduced in lectures.

  1. What is the difference between container-managed and application-managed security?
  2. What are the pros and cons of each? When might you choose to use one in preference to the other?
  3. What annotations can be used to specify security privileges?
  4. Where should those annotations go?
  5. What is a principal?
  6. What is a role?
 

Last updated by Prof Jim Briggs of the School of Computing at the University of Portsmouth

 
The enterprise web programming modules include some material that was formerly part of the WEB1P and WEB2P units.