The document discusses key concepts in Java including the Java programming language and platform, object-oriented programming principles like classes and interfaces, and core collections like ArrayList and HashMap. It also covers common design patterns such as Factory, Facade, and Dependency Injection. The latter part focuses on frameworks like Spring, Hibernate and Struts that provide functionality like inversion of control, transaction management, ORM, and MVC architecture.
Download as PPT, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
42 views
Curso Java
The document discusses key concepts in Java including the Java programming language and platform, object-oriented programming principles like classes and interfaces, and core collections like ArrayList and HashMap. It also covers common design patterns such as Factory, Facade, and Dependency Injection. The latter part focuses on frameworks like Spring, Hibernate and Struts that provide functionality like inversion of control, transaction management, ORM, and MVC architecture.
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 24
Rodrigo Ruiz
Java technology is both a programming
language and a platform. The Java platform: The Java Virtual Machine The Java Application Programming Interface (API) The Java language: Simple. Object oriented. Distributed. Multithreaded. Portable.
Object: An instance of a class. Represents a real Class: A class is a blueprint or prototype from which objects are created. Interface: An interface is a contract between a class and the outside world. When a class implements an interface, it promises to provide the behavior published by that interface. Inheritance: Allows classes to inherit commonly used state and behavior from other classes. Polymorphism: Ability to create a variable, a function, or an object that has more than one form. Is simply an object that groups multiple elements into a single unit. Collections are used to store, retrieve, manipulate, and communicate aggregate data. Examples: ArrayList Vector HashMap
A collections framework is a unified architecture for representing and manipulating collections. All collections frameworks contain the following: Interfaces: List, Map. Implementations: ArrayList, HashMap. Algorithms: Serach, Sort, etc.
Generics allow you to abstract over types. The most common examples are container types, such as those in the Collections hierarchy. List<Integer> myIntList = new LinkedList<Integer>(); Integer i = myIntList .get(0); Simple User Defined Generic public interface DAO<E extends Object> { void add(E x); } Create a generic DAO object to be used for all CRUD operations. Annotations provide data about a program that is not part of the program itself. They have no direct effect on the operation of the code they annotate. Annotations have a number of uses, among them: Information for the compiler Annotations can be used by the compiler to detect errors or suppress warnings. Compiler-time and deployment-time processing Software tools can process annotation information to generate code, XML files, and so forth. Runtime processing Some annotations are available to be examined at runtime.
@Retention(RetentionPolicy.RUNTIME) @Target( { ElementType.METHOD }) public @interface JciBatNapaDebiTransactionalRequired {
} Facade: The Faade design pattern simplifies complex APIs by providing a simplified interface to a complex subsystem. Dependency Injection: Dependency injection (DI) is a design pattern in object-oriented computer programming whose purpose is to reduce the coupling between software components.
Factory: The factory method pattern is an object-oriented design pattern to implement the concept of factories. Creates objects (products) without specifying the exact (concrete) class of object that will be created.
DAO Hibernate Business View Struts II SPRING Facade Manager The Spring Framework comprises several modules that provide a range of services: Inversion of control container: Don't call me, I'll call you. Integrated transaction management. MVC web framework. Authentication and authorization: configurable security processes that support a range of standards, protocols, tools and practices via the Spring Security sub-project (formerly Acegi Security System for Spring). The IoC container (Pag. 29). Transaction Management (Pag. 303). DAO support (Pag. 337). Object Relational Mapping (ORM) Data Access (Pag. 384). Hibernate is an object-relational mapping (ORM) library for the Java language, providing a framework for mapping an object-oriented domain model to a traditional relational database. Chapter 4. Chapter 6. Chapter 17. Chapter 18. Chapter 24. Chapter 25. Chapter 26. Chapter 27.
Web applications based on JavaServer Pages sometimes commingle database code, page design code, and control flow code. In practice, we find that unless these concerns are separated, larger applications become difficult to maintain.
One way to separate concerns in a software application is to use a Model-View-Controller (MVC) architecture. The Model represents the business or database code, the View represents the page design code, and the Controller represents the navigational code. The Struts framework is designed to help developers create web applications that utilize a MVC architecture.
The framework provides three key components: A "request" handler provided by the application developer that is mapped to a standard URI. A "response" handler that transfers control to another resource which completes the response. A tag library that helps developers create interactive form-based applications with server pages. http://struts.apache.org http://download.oracle.com/javase/tutorial/ http://www.springsource.org/