backend Flashcards

1
Q

CDI

A

Delar i CDI:

@Inject
@Qualifiers
*om man vill änvända flera interfaces samtidigt

@Alternatives
* flera implementationer av ett interfface

@Produces
* Man kan injekta primitiver int long float array typer och vilken pojo som helst
tack vare producers

konfigurera en CDI Application:

Allt man behöver är att skapa filen Beans.xml den måste finnas i classpath

Disposers:

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

CI/CD

A

Continous Intefration/ Continous Delivery / Continous Deployment

* Automatiseringstrategier 
* bygge av applikation
* Test
* Paketerig
* Distribution
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Decorators

A
  • design mönster
  • wrappa en klass runt en annan klass
  • default disable som interceptors och alternativ
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

EJB

A
Annotations: 
@EJB
@Stateless
@Stateful
@ModelDriven
@PostContruct

server:

life cycemanagement
security
transaction
object pooling

when to use EJB:

needs Remote Access
need Needs to be scalable
nees Encapsulated business logic

Types: 
Session Bean 
 	* Contains Business logic 
Message Driven Bean
	* uses JMS  
Entity Bean
	* its depricated and replaced with JPA
Stateless
	*Saknar internt tillstånd
Stateful
	* har tillstånd
Singleton
	* finns bara i en instans
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

ER-Modell

A
  • Entitet - namnet på tabell
  • Attribut - kolumn i tabellen
  • Relation - Motsvarar av en främmande nyckel i databasen
  • Kardinalitet - Relationer kan ha
    • 1:N (en till många)
    • 1:1 (en till en),
    • N:1 (många till en)
    • N:M (många till många)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

JMS

A

mainly used to send and receive message from one app to another

Messaging topologies

internal broker
external broker
embedded broker

MOM (Message Oriented Middleware)

  • Asynkron kommunikation
  • Köhanterad(extern broker)
    * Mellan 2 aktörer
    * Händelsestyrd
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

JNDI

A

Lokalisera object på nätet

  • Paket
    • Javax.naming.Context
    • Javax.naming.InitialContext
    • Javax .naming.NameingException
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

JPA

A
  • JPA- Java Persistence API
  • ger java utveklare ett sätt att mappa object till relationer och data i databas med ORM
  • har ett eget frågespråk JPQL ( Java Persistence Query Language)
  • Man kan även använda native SQL
  • Man kan beskriva relationer med annotationer

JPA Entiteter

DAO:
public class DAOCLASS{
@PersistenceContext
private EntityManager em;
	public void save(Person person)
	{
		em.persist(person);
	}
	public void update(Person person)
	{
		em.merge(person);
	}
	public void delete(Person person)
	{
		em.remove(person);
	}
public List getPersons(){
	Query query = em.createQuery("SELECT p from Person as p);

	return query.getResultList();

}

public 

}

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

JTA

A

Java Trans actions API (JTA)

  • Transaktioner i java är åtgärder som måste avslutas framgångsrikt
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Life Cyclephases

A
Validate
complie
test
package
verify
install
deploy
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

RMI

A

RMI Remote Method Invocation

RMI provides remote communitcation beetween java programs

  • Transport Layer
    • Handles Client and server Connections
  • Stub
    • acts as a gateway for the client program
  • Skeleton
    • server side object that stub pass requests too
  • RRL(Remote Reference Layer)
    • Manages the references by the client to the remote object

When the client makes a call to the remote object, it is received by the stub which eventually passes this request to the RRL.

When the client-side RRL receives the request, it invokes a method called invoke() of the object remoteRef. It passes the request to the RRL on the server side.

The RRL on the server side passes the request to the Skeleton (proxy on the server) which finally invokes the required object on the server.

The result is passed all the way back to the client.

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

Scopes

A

SCOPES:

DI definerar följande scopes:

Application Scope
*Bönan skapas bara en gång under hela applikationen

Session scop :
* skapas för att finnas under en hel http session och discarded när sessionen avslutas

Request scope :
*innebär att bönana skapas för längden av metod anropet och avslutas när metoden avslutas

Interceptors:
* containern intercept avbryta anropet innan bönans metod anropas

4 typer av interceptor:er

* Constructor-level interceptors: 
	* interceptor associerad med en constructor för target class:en (@AroundConstruct)

* Method-level interceptors: 
	* assosierad med business method (@AroundInvoke)

* Timeout method interceptors: (@AroundTimeout) bara vid EJB timer service)
* Life-cycle callback interceptors (@PostConstruct and @PreDestroy
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Java Securing

A

TEKNINKER :

  • JCE (Java Cryptography Extension)
  • JSSE ( Java Secure Sockets Extension)
  • JAAS (Java Authentication and Authorization Service)
  • DBMS
    • JGSS(Java General Security Service)
    • CertPath API(Java Cerification Path API)

DMZ-reverse proxy
SSL

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

Temporal Types

A
  • temporal är data object för datum eller tid man vill lagra i databas

@Temporal(Temporal.DATE)
@Column(name=”S_DATE”)
priate Date startDa

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

Tester

A

JUnit - ramverk

Annotationer: 
@Test
@BeforeAll
@AfterAll
@DisplayName

Assertions:

assertTrue()
assertFalse()
assertEquals()
assertThrows()
assertNotEquals()
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

@Transient

A

Transient

*Ibland vill man lagra attribut i klassen som inte ska sparas;

17
Q

VO

A

VO

  • Använd VO klasser som ett sätt att transportera data i systemet
    jämför med DTO (data transfer object)
  • innebär att entitets-klasserna bara används internt inom data tier
18
Q

JCP

A

Java Community Process

19
Q

JSR

A

Java Specification request