-
Inversion Of Control
Object coupling is bound at run time by an "assembler" object
- based on how they are used
- based on their interaction with each other
objects give their own dependencys
-
Inheritance
Concrete class extends another
- is - a relationship
- extends
- implements
'concrete' = commonalitys
-
Containers
the interface between a component and the low-level platform specific functionality that supports that component.
before a component can be executed; it must be deployed into its container
-
what is a web container
servlet or jsp = web container
manages the execution of jsp page and servlet components
-
Dependancy Injection
needs at least 3 elements
- 1) a dependent consumer
- 2) a declaration of components dependencies, defined as interface contracts
- 3) an injector (provider or container) creates instances of classes that implement a given depenency interface or request
ex.. the dependant object (1) describes what software component it depends on to do its work (2) the injector decides what concrete classes satisfy the requirements (3) and send those classes to the dependant object
-
Servlet
[controller]
programs that run on the web server and build web pages
-
Association
a relationship between 2 classes where one class uses another (general)
- a - relationship
- ex.. rooms are in a house
-
Aggregation
a special type of association
- the - relationship
- ex.. house is the aggregator of the room
- no room without a house
-
Composition
a special type of aggregation
- has - a - relationship
- ex.. house has rooms
house is a composite object
-
whats the difference between association, aggregation, composition
- aggregation is a special type of association..
- composition is a special type of aggregation
- association = general
- aggregation = middle
- composition = core
-
Decoupling
careful controls that seperate code modules from particular use cases
increases code re-useability
ex.. polymorphically decouple the encapsulation (using a method interface which an encapsulated object must satisfy)
- Bridge pattern
- Adapter pattern
-
Abstraction
- reduce complexity by a supression of detail
- what an object 'is' or 'does' not how
- hide irrelevant details
- an emphasis on the idea
-
Generalization
reduces complexity by elimination similurities
replacing multiple entities which perform simular functions with a single construct
- = Polymorphism
- an emphisis on the similarities between objects
-
Parameterization
Abstracts are generalized through 'parameterization' to provide greater unity
- 1) one or more parts of an entity are replaced with a name which is new to the entity
- 2) the name is used as a parameter
- 3) when the parameterized abstract is invoked, it is invoked with a binding of the parameter to an arguement
ex.. Hibernate
-
JSP
java server pages
- action = 'resource'
- method = 'GET / POST'
-
Container Services
- lifecycle management
- security
- deployment
- threading
runtime support of a system-level entity
-
XML - RPC
xml remote procedure calls
loose coupled web service
-
SOAP
simple object access protocol
- basic messaging framework (3) parts
- 1) envelop = what is in the message and how to process it
- 2) encoding rules = how to express instances of application - defined datatypes
- 3) convention for representing procedure calls and responces
Extensibility, Neutrality, Independence
-
Collections
Java.Util.Collections.*
- List = FIFO
- Set = FI?O
- Map = (key, value)
-
Transaction Management in EJB
ACID
- Atomic = all or nothing
- Consistancy = all updated together
- Isolation = only user can see info until complete
- Durability = once complete all users can see
-
Life Cycle of Session Beans
- STATELESS ........./........... STATEFULL
- .........................................(remembers info)
- ejbCreate(); ........................... ejbCreate();
- init(); .......................................init();
- ejbActivate();
- ServiceMethods(); ...................ejbService();
- ejbDestroy(); ...........................ejbPassivate();
-
EJB
- Enterprise Java Bean = a server side component that encapsulates the business logic of an application
- ex...
- login()
- chechOut()
- uploadPic()
- Session Beans = Stateless / Statefull
- Entity Beans = (ORM) Object Relational Mapping ex.. Hibernate
- Message Beans = Java Messaging Service
-
EJB Container
provides system level services to the BEAN
- ex..
- transactionManagement()
- securityAuthorization()
-
Session Bean
represents a single client inside the server
- not shared
- data is not saved
-
Entity Bean
[Entity]
represents a business object in a DB
- persistant - still exists after the server process
- sharred - transactions (EJB container)
- have primary keys
- can be a join
-
Message Driven Bean
- allows applications to process messages asynchronously
- acts as the JMS Listener (recieves messages)
- clients do not access
- retain no data
-
-
JDBC
CSR
- Connection to DB
- Statement SQL
- ResultSet = answer
-
Type Safe
you can only use one kind of 'type'
ex.. Box<Integer> boxInt = new Box<Integer>();
-
How to understand a System
Identify the module of the system
then dig deep into each module seperately to seek out classes
-
How to identify a Class
- 1) fully list the leaf level functions / operations of the system (granular level use case)
- 2) group each function to form classes (classes will group same types of functions / operations)
a well defined class must ba a meaningfull grouping of a set of functions and should support the re-useability while increasing expandability
-
How to design a Class
- 1) SRP = Single Respository Principle
- a class should have 1 and only 1 reason to change.
- 2) OCP = Open Closed Principle
- you should be able to extend a class, without modifying it.
- 3) LSP = L Substitution Principle
- derived classes must be sustainable for their base classes.
- 4) DIP = Dependency Inversion Principle
- depend on abstractions, not conretions.
- 5) ISP = Interface Segregation Principle
- make fine grained interfaces - client specific
-
Class
- 1) name
- 2) attributes
- 3) operations
a representation of a type of object
it is the BLUEPRINT, PLAN, TEMPLATE that describes the details of an object
-
OOP
a group of self sustainable objects
a class represents these objects
in order to manage these classes of a system and reduce complexity, designers use
- Encapsulation
- Abstraction
- Inheritance
- Polymorphism
-
The primary goal of Software Architecture
- define non - functional requirements of a system
- define the environment
-
Define Software Architecture
The Rules, Heuristics, and Patterns governing:
- 1) Partitioning the problem/system into discrete pieces
- 2) Techinques used to create interfaces between pieces
- 3) Techniques used to manage overall structure and flow
- 4) Techniques used to interface the system to its environment
- 5) Appropriate use of development and delivery approaches, techniques, and tools
-
Why Architecture is important
- controls complexity
- enforces best practices
- gives consistency, and uniformity
- increases predictability
- enables re-use
-
Date Access Layer
Basic interactions with DB
CRUD
- Create
- Retrieve
- Update
- Delete
this should be simple and efficient
-
SOA
Service Oriented Architecture
seperates functions into Services which are available over a network in order to allow developers to combine, and reuse in the production of applications
-
Use Case
a thing an actor percieves from the system
maps actors with functions
defines the requirements for your system
-
Method Overriding
Allows a subclass to override a specific implementation of a method that is already provided by one of its super - classes
-
Static
a variable or functions associated with a class... rather than with objects of a class
does not need impementation
-
Encapsulation
ex.. Interface
- keeping or making the fields in a class private.
- providing access to the fields via public methods
-
Polymorphism
the ability of an object to take on many forms
the ability to request that the same operations be performed by a wide range of different types of things
-
Interface
Divide and Conquer
- contains no method bodies
- all methods must be used
seperates the implementation and defines the structure
- - must be implemented
- - you can implement more than one interface
-
Protected
Only visible to the class itself, its subclasses, and classes in the same package
-
Abstract Class
- cannot be instantiated
- can only be used as a super - class for other classes that extend the abstract class
- more flexable than an interface
- can provide some default behavior for base class
-
Abstract Class vs. an Interface
Abstract Class can not be instantiated.. it only allows other classes to inherit from it
Interface has no implementation.. just empty methods without a body
the main difference is that an class can implement more than one interface, but can only inherit from one class (abstract or not) interfaces are used for multiple inheritance..
Flexability; Abstract classes are flexable because you can use only what you need from it.. while an interface requires that you implement all of its methods.
-
Messaging
an exchange of messages between software components
- loosely coupled
- indirect communication
- senders do not need to have knowlege of recievers
-
Superset vs Subset
'a' is inside of 'b'
- = 'a' is a subset of 'b'
- = 'b' is a superset of 'a'
-
Final
a final Class can no longer be subclasses
a final Method can not be overiddon
a final Field can not be changed
-
final vs. finally vs. finalize
final = constant declaration (can not be changed)
- finally() = finally block
- try() {
- }catch() {
- }finally() { // used to release resources irrespective of expectations
- }
finalize() = a method that is invoked before an object is discarded by garbage collection
-
What is the difference between
requestDispatcher()
sendRedirect()
- requestDispatcher() = server side redirect with
- request objects
- response objects
- sendRedirect() = client side redirect with
- new request objects
- new response objects
-
Generic Types
a special kind of variable, whose 'value' will be whatever type you pass in
- E - element
- k - key
- N - number
- T - Type (most common)
- V - value
-
Synchronization
threat safe
it places a lock or hold on the method or block preventing two objects from accessing the same block or method at the same time.
-
Synchronized Block vs. Synchronized Method
synchronized blocks place locks for shorter periods than synchronized methods
-
How do I find wheather a parameter exists in a request object?
boolean hasParameter = request.getParameterMap().contains(theParameter);
-
Casting
the process of converting data from one type to another
-
Implicit Casting
- automatic type casting by the compiler
- data of one or more subtypes can be converted to a supertype
if(d > l) d = l;
-
Explicit Casting
needs to be done in the program
- ex..
- double da = 3.3;
- double db = 3.3;
int result = (int)da + (int)db;
-
Parser
the process of analyzing a text made up of a sequence of tokens.
analyzing a group of words
-
How do xml Parsers differ
by the relationship between the xml parser client
1) DOM Parser = returns a 'tree' of the document
2) PUSH Parser = call clients methods with xml events
3) PULL Parser = returns xml events to a client on request
-
Difference between SAX & DOM Parsers
- SAX = simple API for xml (small)
- does not create any internal structure instead it takes the occurances of the components of an import document as 'EVENTS' and tells the client what it reads through the input document
- DOM = document object model (big)
- create a 'TREE' structure in memory from an input document and then waits for requests from client
|
|