Basic terms Flashcards

1
Q

Specification - framework

A

Specification of the frameworks - interfaces
List of requirements

Any frameworks implement the same specification can be replaced one by another.

  • One or more specification that explains the details and defines functionalities.
  • Reference Implementation for the specification.
  • Compatibility Test Kit.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Enterprise application?

A
  • Deal with huge data.
  • Consistent change, and complexity.
  • Must be robust.
  • Highly available, scalable, and secure.
  • Develop business-to-business communication.
  • Multiple programming languages.
  • Different protocols.
  • Different locations.
  • Java Enterprise Edition, launched 1999
  • Java EE, is now simpler, easier, more portable.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Problems/inconveniences of using JDBC?

A
  • Have to know SQL to use JDBC
  • How and where to store object attributes to tables - mapping object to table
  • Runtime problem - syntax checking in runtime
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Advantages of using JDBC?

A
  • Prepared statement
  • Fast - lowest level of programming
  • Not depends on type of DB
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

JavaEE

A

Is the collection of specs to solve Enterprise problem

JEE Umbrella JSR, Platform Edition Specification.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

CTK - Compatibility Test Kit.

A

set of test each implementation has to pass to qualify to named an implementation of the spec.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How is data handled in RDBM?

A
  • Contain business data.
  • Process data through triggers & SP.
  • Data is stored in tables of rows and columns.
  • Primary keys identify data.
  • Foreign keys & joins establish relations.
  • Data exists even if the RDMS is not running.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How is data handled in Java?

A
  • Stores business data in attributes (either primitive types or instances of objects).
  • Manipulates data through methods using objects.
  • Data exists only if the JVM is running.
  • Inheritance, interfaces, enumerations, abstract classes, …
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Java Persistence

A

Persistence is to keep the data alive even after the program that is running it is terminated.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How can you achieve Persistence in Java

A
•Serialization
•File
•XML
•Database
- JDBC
- ORM
- JPA
- Spring Persistence
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Java Persistence API

A

As a specification, the Java Persistence API is concerned with persistence, which loosely means any mechanism by which Java objects outlive the application process that created them.

The JPA specification lets you define which objects should be persisted, and how those objects should be persisted in your Java applications.

By itself, JPA is not a tool or framework; rather, it defines a set of concepts that can be implemented by any tool or framework.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

JPA components

A
List of APIs
•ORM
•Entity Manager API (CRUD) operations.
•JPQL (Java Persistence Query Language) OOQL.
•Transactions, JTA & non-JTA
•Callbacks and listeners.
•Optional XML mapping
Built on top of JDBC, so you are still eventually using JDBC, but you don’t worry about it.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Entity

A
  • Objects that live shortly in memory, and persistently in a database.
  • Mapped to database.
  • Can be concrete or abstract.
  • Support inheritance, associations, and so on.
  • Manageable by JPA.
  • Can be queried using JPQL.
  • Follows a defined life cycle.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How to implement Entity?

A

•An annotated Java Class (or an XML descriptor).
@Entity
Must:
•Have id @Id @GeneratedValue
•Have a default constructor.
•Not final.
•Implement Serializable when it has to be passed as detached objects.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Entity Lifecycle

A

Entity is a POJO.

When managed by Entity Manager (attached)
•it has a persistence identity.
•It has a synchronized state with a database.

When not managed they are detached
•Used as regular java classes (garbage collected)

Operations on entity:
•Persist (Create)
•Update (Update)
•Delete (Delete)
•Load (Select)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

ORM – Object Relational Mapping

A
  • Maps the objects oriented world to the relational database world.
  • A world of classes, objects, and attributes is mapped to tables of rows and columns.
  • Delegate the access to database and conversion from db to OO to an external framework.
  • Metadata is used to describe mapping.
  • Annotations
  • XML
  • Convention over configuration, configuration by exception, programming by exception.
  • Uses JDBC
17
Q

Entity Manager

A
  • Orchestrates entities.
  • Manage entities.
  • CRUD operations on entities.
  • Execute complex queries using JPQL.
  • It is an interface, that is implemented by different Persistence Providers.