Instantiate Object & Encrypt Data – Computer Exam

Twitter - Quiz Tutors
Instantiate Object & Encrypt Data - Computer Exam. Facebook - Quiz Tutors

Instantiate Object, Encrypt Data, Design Pattern

The key terms of this Computer Science Exam include Iterator, Design Pattern, Instantiate Object, Encrypt Data, Software.


structural design pattern – allows interface of existing class to be used as another interface & allows objects w/ incompatible interfaces to collaborate
adaptor is a
Uses dependency Inversion Principle
– adaptor implements an interface that Client calls on


creational design pattern – replace direct object construction calls (new) with a factory method
Establishing constructor
Not coupled to client


creational design patter – ensure class has only one instance & providing global access point to instance
Don’t want several instances to access same info
Use static final
Java application – Runtime class – single instance
– use getRuntime to get the one instance of Runtime


behavioral design pattern – traverse elements of a collection w/out exposing underlying representation
Open/close principle
– when creating new iterator — build on existing iterator

Dependency Injection Pattern

Instantiate object outside class –> inject it into the class (pass into constructor)
In Model class, passes Database object into class
Benefit: looser coupling, enable separation of concerns (class does not need to know how to instantiate object)
Object being injected = SERVICE
code passing in service = INJECTOR

MVC Pattern

For web applications
higher level
Model <–> Controller <–> View

Gang Of Four – Design Patterns

Creational Patterns – how to create objects
Structural Patterns – how to organize classes/objects
Behavioral Patterns – how classes interact with each other


structural design pattern – compose objects —> tree structures to represent whole-part hierarchies
Grouping & ungrouping primitive types
– treat a group of objects same way as single instance
Enables nesting


HTTP allows client-server communication
– guarantees visitors data is coming from server
– encrypts data being transmitted

SSL Certificate

digital certificate – authenticates identity of website & encrypts info sent to server using SSL tech
Serves two purpose
– authenticates the identity of the website (this guarantees visitors that they’re not on a bogus site)
– encrypts the data that’s being transmitted

How to use HTTPS on SparkJava

1. generate certificate using openssl
2. call secure before setting up routes

Software requirement specification

Problem Statement
Potential Clients
Proposed Solution
Functional Requirements
– must haves
– nice to haves
Software Architecture
Wire Frame


Run before every test


Runtime Exception


create, read, update, delete


Data Access Object – design pattern


Representational State Transfer
client-server architecture
server and client do not know about each other – stateless

RESTful System

uses REST model
uses HTTP to transfer protocol


Hypertext Transfer Protocol
GET – retreat resources
POST – create
PUT – update
DELETE – delete
HTTP request has
header (info about request) , body (data, optional), path (address)

Interface Segregation Principle

when a class implements an interface, all the functions implemented should be meaningful
if not, separate interface into multiple ones


parent uses the child where the child class used cannot exist on it own
instance of child created inside parent


child instance passed into parent through constructor
deleting parent child still exist