Wednesday, September 26, 2007

knoledzs

A Jini elég szépen fejlődik. Számomra a leglátványosabb része jelenleg a javaspaces, de ugye az csak töredék. Lásd még wiki.




Lássunk valami barátságos másik dolgot :) Úgy hívják hogy "J2EE, Hibernate, Spring, Struts, JSP, Servlets, Ajax". Nyilván van aki úgy születik, a többieknek meg itt egy kis gyűjtemény...
Kötekedni persze ér, hogy nem tökéletes/hibás/túlzás, de teljesen felesleges. Egyrészt mert ha ki akarnám vesézni a témát, akkor itt most 600 megányi doksi lenne, másrészt meg ott a gúgle. Ez itt arra való, hogy aki kezd, annak legyen hol elindulnia.
  • J2EE, inkább nem is mondom, mennyi minden van benne :)
  • Hibernate: perzisztencia réteg. A J2EE kicsit nehézkes ezen a téren. A lényeg, hogy a business layer-ben POJO-kkal dolgozol, meppeled őket egy xml-ben és majd a többit megcsinálja a hibernate. Tutorial.
  • Spring. Light weight containter. XML-el konfigurált rendszer, ami nagy mértékben használja az IoC (Inversion of Control: a konténer setupolja a bean-t az xml alapján, nem a developer a kódból). Tutorial.
  • Struts: guide. A JSP előnyeit megtoldja azzal, hogy action-okat definiál, így gyakorlatilag szervletek visznek át egyik jsp-ről a másikra. Lefed még nagyon sok mindent, ami egy webes alkalmazásban előfordul (lokalizáció, validálás,...). Azóta újraírták, struts2 alatt lehet megtalálni a tutit. A tippek, mindenesetre hasznosak. Főleg a performance tuningról.
  • JSP: egy kódokkal tarkított dinamikus weboldal (részlet). Arra jó, hogy ne kelljen azt oldalt kódbol kigenerálni, illetve szerver oldalon futó kóddal tudjuk variálni azt, ami megjelenik. Ha jól van megcsinálva, akkor nincs benne business logic, csak és kizárólag megjelenítésre használjuk.
  • Servlets: kód, ami a requesthez kigenerálja a response-t. Tutorial.
  • Taglib: Egyszerüsíti az életet, mert saját illetve standard tag-ekkel lehet egy jól átlátható view-t megcsinálni. Néha verziokeveredés van.
  • Ajax: Asynchronous JavaScript and XML. A lényeg, hogy nem az egész oldalt frissítjük a böngészőben, csak egy javascript objektummal kérjük le az adatot a szerverből és a visszaadott XML alapján frissítjük azu oldal bizonyos részeit (DOM fában updatelünk). Getting started. Tutorial. Security problems.
  • patterns/best practices: megoldási javaslat gyakori problémákra, szituációkra. Terjedelmes irodalma van, például ez, vagy ez, vagy a sun-os, de ott van még a Gang of Four is. Érdemes a wiki-re ránézni.
Hibernate áttekintés:
Top-down: ha nincs séma hbm2ddl-el a létező mappingból kigenerálható.
Bottom-up: hbm2hbmxml és hbm2java-val a létező adatbázisből megcsinálható a mappolás és a dao.
Middle-out és meet in the middle is van, de minek :)
hibernate.properties (classpaht root-ban) és hibernate.cfg.xml (ez override-ol). Ha a @Entry ott van, akkor minden property default mentésre kerül a default táblába (ez módosítható a @Table, @Column, @JoinColumn-al)

Spring áttekintés:
XML-ben leírjuk, hogy ha kell egy bean, akkor hogy szerelje nekünk össze a konténer (konstruktoron illetve settereken keresztül milyen propertyket és referenciákat állítson be rajta).

Struts áttekintés:
JSP
áttekintés:
Servlets
áttekintés:
Ajax
áttekintés:
AXIS: Web service generáláshoz. tutorial.

Patternek: (nem szarozok, copy paste "pattern":)

SUMMARY OF CREATIONAL PATTERNS

· The Factory Pattern is used to choose and return an instance of a class
from a number of similar classes based on data you provide to the
factory.
· The Abstract Factory Pattern is used to return one of several groups of
classes. In some cases it actually returns a Factory for that group of
classes.
· The Builder Pattern assembles a number of objects to make a new
object, based on the data with which it is presented. Frequently, the
choice of which way the objects are assembled is achieved using a
Factory.
· The Prototype Pattern copies or clones an existing class rather than
creating a new instance when creating new instances is more expensive.
· The Singleton Pattern is a pattern that insures there is one and only one
instance of an object, and that it is possible to obtain global access to that
one instance.

BEHAVIORAL PATTERNS

Behavioral patterns are those patterns that are most specifically
concerned with communication between objects. In this chapter, we’ll see
that:
· The Observer pattern defines the way a number of classes can be notified
of a change,
· The Mediator defines how communication between classes can be
simplified by using another class to keep all classes from having to know
about each other.
· The Chain of Responsibility allows an even further decoupling between
classes, by passing a request between classes until it is recognized.
· The Template pattern provides an abstract definition of an algorithm, and
· The Interpreter provides a definition of how to include language elements
in a program.
· The Strategy pattern encapsulates an algorithm inside a class,
· The Visitor pattern adds function to a class,
· The State pattern provides a memory for a class’s instance variables.
· The Command pattern provides a simple way to separate execution of a
command from the interface environment that produced it, and
· The Iterator pattern formalizes the way we move through a list of data
within a class.

SUMMARY OF STRUCTURAL PATTERNS

In this chapter we have seen the
· The Adapter pattern, used to change the interface of one class to that of
another one.
· The Bridge pattern, intended to keep the interface to your client program
constant while allowing you to change the actual kind of class you
display or use. You can then change the interface and the underlying class
separately.
· The Composite pattern, a collection of objects, any one of which may be
either itself a Composite, or just a primitive object.
· The Decorator pattern, a class that surrounds a given class, adds new
capabilities to it, and passes all the unchanged methods to the underlying
class.
· The Façade pattern, which groups a complex object hierarchy and
provides a new, simpler interface to access those data.
· The Flyweight pattern, which provides a way to limit the proliferation of
small, similar class instances by moving some of the class data outside
the class and passing it in during various execution methods.
· The Proxy pattern, which provides a simple place-holder class for a more
complex class which is expensive to instantiate.

No comments:

Post a Comment