Thursday, 24 May 2012

MULE ESB - Configuration


MULE ESB - Architecture



MULE - ESB


ESB features


"Restful WebServices" - in NutShell

Intro:
  1) REST is an Arch style, based on
                     a) Web Standards
                     b) HTTP Protocol

  2) Everything is a "RESOURCE"
  3) REST Client ---> REST Service
  4) Resources are identified as "Global IDs" (URLs)
  5) HTTP Methods  -  (GET, PUT, POST, DELETE)
  6) MIME Types are - (XML , Text, JSON, User-defined..)
  7) JAX-RS supports
                  a)  XML
                  b)  JSON (via JAXB)

 8) JAVA -> REST -> JERSEY

 9) Register Servlet provided by Jersey Via "Web.xml"
 10) Define the PATH, under which your Application is available
     
       Base URL of Servlet is


http://your_domain:port/display-name/url-pattern/path_from_rest_class

 11)This servlet which analyze the incoming HTTP request and select the correct class and method to respond to this request. This selection is based on annotation in the class and methods.
 12) The complete path to a resource is therefore based on the base URL and the @PATh annotation in your class.

http://your_domain:port/display-name/url-pattern/path_from_rest_class

13) JERSEY - contains "Rest Server" + "Rest Client"

Wednesday, 23 May 2012

Spring - in NutShell


Advantages of Spring:
    1) Layered Arch (only take what you need !! )
    2) Enables POJO Programming
    3) DI & IOC simplifies JDBC
    4) Open Source

Advantages of IoC:
    1) Lesser Source Code
    2) Making Application - more testable
          a) no need of Singletons
          b) no need of DNS lookups
    3) Loose Coupling
    4) IOC Containers support
               a) Eager Instantiation
               b) Lazy Loading of Services
Injections:
     1) Setter Injection
     2) Constructor Injection

Modules:
     1) Core Container
     2) Spring- Context
     3) Spring- AOP
     4) Spring-DAO
     5) Spring-ORM
     6) Spring- Web Module
     7) Spring- MV Framework

Advantages of Application Context:
   1) Resolving "text Messages"
   2) Support for "internationalisation"
   3) Generic way to load  - "File Resources"
   4) Sending Events to BEANs (which registered as Listeners)

Multiple Context Files:
    Splitting Web Application Context into
                   1) Persistance.xml
                   2) Transaction.xml
                   3) Service.xml

Spring - Features

1) Light Wt
2) Inversion Of Control
3) Aspect Oriented (AOP)
4) Container
5) MVC Framework
6) Transaction Management
7) JDBC Exception Handling

Annotations in Spring 3.0

@Controller
@RequestMapping("/language")

@Inject

@Component
@AutoWired

@NotBlank
@Service
@Secure
@PathVariable

Disadvantages of "Struts "

1) Unable to carry out - UNIT Testing
2) problems of Exception handling
3) Robust Framework
4) Learning Curve - slow
    Tough to learn  & tough to master it
5) It only takes care of CONTROLLER. & focuses more on VIEW Part.
It doesn't help you to develop MODEL,
It doesn't support "Event Driven MODEL"



Spring 3


Struts 1.2





Tuesday, 22 May 2012

Components of "Presentation Layer"

Components of "Presentation Layer"
-----------------------------------------
1) Page Display
        HTML -> Static Content
        JSP -> Dynamic Content
  
2) User Validation
     Client Side -> Validation
     Server Side -> Validation

3) Data Processing

4) Navigation

5) Security

Composite Keys Vs Surrogate Keys

Composite Keys - BAD

Surrogate keys - Good :) 

Concurrency with Java Threads

1) basic "Notify Events" - can not be queued.
 - if no threads waiting, Notify() - does nothing..
2) If you need "NOTIFICATIONS" be queued, we need to go beyond Wait()/Notify()/NotifyAll()

     - a) Semaphore (without Buzy waiting..)
     - b) Cyclic Barrier
     - c) CountDown Latch

Wait() - Notify() NotifyAll()

Synchronized(Mutex)

Thread-Singalling
Thread-Yielding

"Volatile " - in Threads