Thursday, January 18, 2007

Design Patterns

  • From a list, select the most appropriate design pattern for a given scenario. Patterns will be limited to those documented in Gamma et al. and named using the names given in that book.
  • State the benefits of using design patterns.
  • State the name of a design pattern (for example, Gamma) given the UML diagram and/or a brief description of the pattern's functionality.
  • Select from a list benefits of a specified design pattern (for example, Gamma).
  • Identify the design pattern associated with a specified J2EE feature
======
Design Patterns(23)
Benefits: Proven solutions, promote reusability, Expressive.
GOF patterns Creation
  • Abstract Factory - Allows a client to create families of objects without knowing their concrete classes.
  • Builder
  • Factory Method - Subclasses decide which concrete classess to create.
  • Prototype
  • Singleton - Ensures one and only object is created.

Behavioural
  • Chain of Responsiblity
  • Command - Encapsulates a request as an object.
  • Interpreter
  • Iterator
  • Mediator
  • Memento
  • Observer - Allows objects to be notified when state changes.
  • State - Encapsulate state based behaviour and use delegation to switch between behaviour.
  • Strategy - Encapsulates interchangeable behaviour and used delegation to decide which ones to use.
  • Template Method - Subclasses decide how to implement steps in an algorithm.
  • Visitor
Structural
  • Adapter - Wraps an object and provides an interface to it.
  • Bridge
  • Composite - Client treats collection of objects and individual objects uniformly.
  • Decorator - Wraps an object to provide new behaviour.
  • Facade
  • Flyweight
  • Proxy - Wraps an object to control access to it.

Feature Pattern
EJB Home
  • Factory
  • Abstract Factory
EJB Remote
  • Proxy
  • Facade
  • Decorator
Session beans that model workflow
  • Facade
EJB instance pooling
  • Flyweight
Value object
  • Memento
JDBC Resultset
  • Iterator
JDBC, JMS, JCA, or any bridging technology
  • Bridge
ServletContext
  • Singleton
Servlet filters
  • Chain of Responsibility
  • Decorator
JMS
  • Observer
  • Mediator



Need to know all patterns, able to differential between the similiar and identify them from givem UML diagrams.
Books used HeadFirstPatterns/ Developer works/ MarkCade's SCEA.

Tuesday, January 16, 2007

Security

  • Select from a list security restrictions that Java 2 environments normally impose on applets running in a browser.
  • Given an architectural system specification, identify appropriate locations for implementation of specified security features, and select suitable technologies for implementation of those features.
Fundament goal: Protect data from unauthorized reading/modification, protection of computer resources against unauthorized use and guaranteeing correctness and availability of resources and data for authorized persons and entities.

Security Manager: categories of permission.
Permitted Operations:
  1. Ability to create a thread
  2. Limited ability to manipulate threads that the browser created for applet Security manager doesnt monitor CPU/Network or bandwidth utilization.
  3. Ability to perform manipulations for the AWT for GUI to work properly
  4. Ability to read system properties, but not modify them
  5. Allowed to make network connection only to host from which it was loaded(if not it could start Dos and also try to connect to internal resouces/systems of the local network)
  6. Cannot change the prioirty of the threads but can request more memory and throw OutOfmemoryException.
  7. Message digest is proof that a piece of data has not been modified. The process of creating message digest is know as hashing. Java 2 suports this.
  8. If applet is not trusted then it cannot do anything on the client machine.
  9. Cannot read/write from client
  10. Cannot read java.home or java.classpath.

Denied Operations Any operation that might be used to compromise the host is usually denied.
Exceptions to this are CPU Usages, Bandwith usagea and memory usage.

Principal, Roles, Identification, Authorization, Authentication, Access control.

Cryptography 1) Symmetric 2) Asymmetric - Has 2 keys private and a public key. Public key can be used to encrypt the message. It cannot be used to decrypt the message or derive the private key. Only the private key can be used to decrypt the message. Asymmetric cryptography is CPU intensive. Also know as public key crytography.

Signatures and Certificates.

SSL, HTTPS, WEB logins

Notes from cade/web/Simulators

Messaging

  • Identify scenarios that are appropriate to implementation using messaging, EJB, or both.
  • List benefits of synchronous and asynchronous messaging.
  • Select scenarios from a list that are appropriate to implementation using synchronous and asynchronous messaging.
Whats is messaging?
  • Peer to peer facility
  • Message agents provide facilities for creating,sending,reading and receiving messages.
  • Enables distributed comm that is loosely coupled
  • Messaging is used for comm between software applications or components.
JMS API
  • Minimizes the set of concepts a prgmer must learn to use messaging products.
  • Provides enough featurs to support sophisticated messaging apps.
  • Maximises the portability of JMS apps across provider.
  • Enables comm which is loosely coupled, asynchrounous and reliable.

Messaging Domain
  1. Point to point
    1. Build around the concept of message queues/senders and receivers.
    2. Sender/Receiver of a message has no timing dependency.
    3. Receiver acknowledge the successful processing of a message.
  2. Publish & Subscribe
    1. Each message can have multiple consumers.
    2. Pub/Sub have a timing dependency. A client that subscribes to a topic can consume only messages that have been published after the subscription and must continue to be active to receive messages.
In pub/Sub model clients address message to a topic. Publisher and subscriber are generally anonymous and dynamically publish/subscribe. Topics retain messages only as long as it takes to distribute them to current subscribers.

Use pub/sub messaging when each message is consumed by 0,1 or *consumers.
  • A JMS provider may implement one or both domains.
  • A J2EE provider must implement both domains.
MOM
J2EE 1.2 Service provider was required to provide the JMS API interface and not the implementation.

J2EE 1.3 MOM is the integral part of the platform and developers can use the messaging features with other APIs.

JMS Arch
JMS Provider is the system that implements the JMS interface and provides admin constrol or features

JMS Client are prgms written in java that produce or consume messages.

Messages Are objects that communicate information between clients

Administered Objects are preconfigured objs created by the admin for the use of clients
  • Destination objects
  • Connection factories
Native Clients...
Notes from sun/cades scea/web

Common Architectures

01/15/2006
SCEA Notes: Common Architecture
  • Recognize the effect on each of the following characteristics of two tier, three tier and multi-tier architectures: scalability maintainability, reliability, availability, extensibility, performance, manageability, and security.
  • Recognize the effect of each of the following characteristics on J2EE technology: scalability maintainability, reliability, availability, extensibility, performance, manageability, and security.
  • Given an architecture described in terms of network layout, list benefits and potential weaknesses associated with it.
Architecture is a set of structuring principles that enables a system to consist of a set of simiplier systems, each with its own local context independent but consist with the context of the large system as a whole.
The architecture should satisfy both functional(bussiness requirement) and non-functional requirements(service level requirements).
The non-functional(service level requirements) of prime importance are :scalability maintainability, reliability, availability, extensibility, performance, manageability, and security.

Scalability is the ability to add more users as the transactional load increases, but the system still reponds within acceptable limits.
  • Vertical Scaling- Adding capacity(memory,cpu,etc) to existing servers. This is easier of the two types.
  • Horizontal scaling- This is achieved by adding servers to the system.
Maintainability is the ability to correct flaws in the existing functionality without impacting other components. For this the system should be modular, with proper, up to date documentation. This cannot be measured during deployment.

Reliability is the ability to ensure integrity and consistency 9f the application, and its transactions. Horizontal scalibility increases reliability and availability.

Availability :)

Extensiblity is the ability to modify/add without impacting the existing functionality. The main features of an extensible design is ODD with low coupling, interfaces and encapsulation.

Performance ways to increase performance: load distribution, load balancing, efficient programming, resource pooling.

Manageability is the ability to monitor system resources.

Architecutural tiers: Applications can be one tier, two tier or N tier.
In a N-tier arch, each tier is automous unit that can be developed and maintained
separately. J2EE based arch consists of .
Client tier/Web tier/Bussiness or application logic tier/Enterprise information system integration tier/Enterprise information system tier.

Notes from developerworks

Friday, January 12, 2007

i18n

01/11/07
Internationlization i18n in progress
  1. State 3 aspects as to why an application may need to be varied or customized in different deployment locales.
  2. Match the functionality, description or purpose of the following(7): Properties,Locale,ResourceBundle, Unicode, Java.text package ,InputStreamReader and OutputStreamReader.
i18n refers to creating a program that doesnt have information hardcoded into it.
Localization describes the process of configuring an internationalized(i18n) program to a particular region or culture.

Whats to be internationalized.
  • Languages used for messages.
  • Parameter substitution order in message.
  • Languages used in parameter in messages.
  • Numeric/Currency/Date formats.
  • Colors/Symbols

These notes are from SCEA guide by Mark Cade. My review of this book.

Thursday, January 11, 2007

UML Notes

1/10/2007
SCEA Notes: UML

  • Draw UML Diagrams
  • Interpret UML diagrams.
  • State the effect of encapsulation, inheritance, and use of interfaces on architectural characteristics.

UML 2 has two categories of diagrams:
1) Structure diagrams: Shows the static structure of the system being modeled. Example: Class, Component or object diagram.

2) Behavior diagrams: Shows the dynamic behavior between the objects of the systems, like there methods, collaboration and activities. Example activity, Use case and sequence diagrams.


Classifier: In general a classifier is a class but technically a classifier is a more general term that refers to a class, an interface, a data type and a component.

Class name
The UML representation of a class is a rectangle containing 3 compartments stacked vertically.

The attribute section has name: attribute type. The uml specification allows for default values in the attribute list. Ex balance: Dollars = 0.

The operations are documented as name(parameter list): return type Ex getArrivalTime():Date

Inheritance
The ability of one class to inherit the functionality of another class and then add new functionality of its own. This is denoted by a solid line with a closed, unfilled arrowhead pointing to the super class.

Association
Five type of Association:
1) Uni-directional: This is indicated with a solid line arrow à. This case only one class knows about the other. Only one end has the assigned name and multiplicity value.
2) Bi-directional: This is indicated with a solid line connecting both classes with an assigned name and the multiplicity values at both ends.
3) Association class.
4) Aggregation: An associate with an aggregation relationship indicates that one class is part of another. They may be able to live dependently or not.
a. Basic Aggregation: This type the child class can outlive parent class, like the wheels can exist without a car.



b. Composite Aggregation. This is similar to the above diagram except that the diamond is filled. In this case the child class cannot live without the parent class. Ex classrooms cannot exist without school.

5) Reflexive Association. This is an association with the same class.


Packages
Packages are for organizing classes or classifier into a namespace. This is sort of folder like structure for the model. This is represented as a rectangle with a tab at the top-left. The classes included can be should inside a package or with a small circle with solid lines to each class.

Interface: This is considered to be a specialization of the class modeling element. It is represented exactly as a class with the top compartment having an additional text like this <>

A dotted line with an unfilled arrowhead means realization or implementation.
A solid line with a filled arrowhead means inheritance.

Visibility
Public +
Protected #
Private -
Package ~


Added in UML 2
Instances
Roles
Internal Structure
The above notes are from developerworks
--------

Tuesday, January 9, 2007

scea certification??

01/08/2007

My scea online notes, most of these notes are partial and i have only for chapters for which I mainly used web resoures or had a notebook accessible.

I'll use these notes as a last minute check on the day of exam.
Am getting started with this link