ATG Framework

December 28, 2017 | Author: Rangachary Srinivasan | Category: Java Server Pages, Java Servlet, Model–View–Controller, Java (Programming Language), Enterprise Java Beans
Share Embed Donate


Short Description

Download ATG Framework...

Description

ATG Relationship Management Platform (formely Dynamo eBusiness Platform) R.Srinivasan Vamsoft

1

ATG Platform • The ATG Platform and its suite of products is a flexible, Java-based development environment for building personalized applications for the Web and other communication channels (email messaging, wireless devices, etc.). • The platform and its related products, include Dynamo Application Server, ATG Portal, ATG Commerce, ATG Content Administration, and the ATG Control Center. 2

ATG Platform ATG CSC

ATG Merchandising

ATG Search

ATG Portal

OutReach Campaign Optimizer

Knowledge Response Management

ATG ATG Commerce Publishing

ATG Personalization + ATG Scenarios Dynamo Application Framework Application Server

3

ATG Recommendations

ACI

ATG Platform • The ATG Platform includes the following core components: • DAF - Dynamo Application Framework • DPS - ATG Personalization Module • DSS – ATG Scenarios Module

4

ATG Platform • The Dynamo Application Framework (DAF) runs on top of our application server and supplies essential facilities for application development and deployment viz., – Nucleus – Repositories – Tag libraries – Droplets & FormHandlers

• This portable framework is designed to run on the industry’s leading J2EE application servers, like JBoss, IBM WebSphere and Oracle WebLogic. 5

ATG Platform • The Personalization module (DPS) provides tools for visitor profiling and content targeting, enabling to deliver personalized content to customers according to their characteristics and preferences. • The Scenarios module (DSS) adds advanced scenario-based personalization features to the ATG Platform. Using the scenario editor, business managers can design, test, and fine-tune customer management scenarios that track and respond to customer behavior. Business processes can be exposed as workflows. Data analysis and reporting tools, including ready-made business chart templates, are available for charting scenario data. 6

Add-on Products

• ATG Portal provides a customizable framework for building personalized Web portals for specific user communities. • A manufacturing company, for example, might create separate portals for employees, customers, and partners, each providing access to different content and services. The Portal Application Framework (PAF) is the infrastructure developers use to create and administer portals and the individual gears that render content and features (a stock ticker or discussion forum, for example) within portal pages. ATG Portal comes with a set of page template and baseline gears that you can use for your own portals.

7

Add-on Products • ATG Commerce includes everything we need to build and manage personalized ecommerce Web sites. ATG Consumer Commerce provides business-to-consumer (B2C) storefront development features -- product catalog management, pricing, inventory, customer service, etc. • ATG Business Commerce adds support for business-to-business (B2B) transactions, including B2B payment methods (purchase orders, requisitions), account-specific product catalogs and price lists, multiple shipping/billing addresses, etc.

8

Add-on Products • ATG Content Administration (earlier known as ATG Publishing) provides a streamlined system for modifying and deploying content on your site. • The system keeps track of multiple versions of publishable assets (scenarios or catalog items, for example) within specific publishing projects. • Using the workflow editor, you can define how each project moves through the various stages of the publishing process: content creation, editing, check-in, approval, QA and deployment on the live site. 9

Additional Applications • ATG Merchandising application runs on top of ATG Publishing and ATG Commerce and give the Commerce Business users a way of creating and maintaining versioned content of various items like ProductCatalog, Personalization targeters etc., • ATG CSC (Commere Service Center) is a web based application that also integrates a ticketing system, which can be used by the Commerce Call center agents to manage customers, Orders etc., ATG Knowledge and Response Management accumulates and provides CRM related information. • ATG Outreach and Campaign Optimizer are used by the marketing people to create promotions, scenarios etc., to track visitor behaviour and tune the commerce system. 10

• Finally, the ATG Control Center (ACC) is the integrated user interface for the ATG Relationship Management Platform and its supported products. • The ACC provides application developers, page designers, site administrators, business managers, and other members of your project team with point-and-click access to the tools they need for building and maintaining ATG applications

11

Facilities Supplied by DAF • The ATG Platform is supported by a foundation layer called the Dynamo Application Framework (DAF), which runs on top of our application server. • Our application server handles tasks such as session management, load balancing, clustering, and SNMP monitoring. • DAF supplies additional facilities for application development and deployment, including:

12

Facilities Supplied by DAF  Nucleus • Nucleus is the central registry for the JavaBeans that contain our application-level logic. • It creates and configures Dynamo components and organizes them into a hierarchical namespace so they can be referenced by other components. • By reading the various configuration files associated with each component, Nucleus figures out what components to use in an application, what their initial properties are, and how they connect to each other. • Nucleus, thus allows developers to build applications in a component-oriented manner. 13

• Nucleus is the mechanism that creates and configures new components, then gives those components a place to "live" so they can be found by other components. • In Nucleus, every component has a unique name, allowing components to refer to each other. Components are organized into a hierarchy, similar to a file system. This results in component names such as /atg/dynamo/service/Scheduler and gives Nucleus the ability to resolve relative names, such as ../service/Scheduler. Furthermore, Nucleus components are JavaBeans, affording all the advantages of the JavaBean standard. 14

• The Pages and Components task area in the ATG Control Center shows all of the components currently registered in Nucleus (by module or by path) and provides templates to help we create new ones, either from existing Dynamo classes or our own Java classes. • When it comes to configuring components for our application, we can use the built-in Component Editor to specify initialization parameters and the way the components link together. The ACC creates the necessary configuration files automatically. • DAF also provides a Web-based component browser, as part of the Dynamo Administration interface, that we can use to examine and modify components in a running Nucleus application. 15

Facilities Supplied by DAF  Tag libraries • Originally the presentation language used by the framework was JHTML. There are lots of custom tags provided in JHTML to access the dynamo components. • With JSP becoming the defacto presentation language for java, the framework provides the DSP tag library to access Nucleus components and render dynamic content from our JavaServer Pages (JSPs). • Earlier DAF also contained a Core tag library for tags for flow control, manipulating data and handling transactions which has been now deprecated in favour of the JSTL core tag library.

16

Facilities Supplied by DAF  Dynamo Servlet Beans • Dynamo Servlet Beans are specialized Nucleus components that can be embedded in our JSPs to display dynamic content. • Using Dynamo Servlet Beans minimizes the amount of Java code that has to appear in HTML and the amount of HTML that has to be hard-coded into Java classes and also enables the developer to take a “Dispatcher View” approach of MVC2 Design pattern. • As a result, Java programmers and page designers can work independently and applications are easier to maintain. • DAF comes with a set of ready-made Dynamo Servlet Beans that you can use in your pages. 17

Facilities Supplied by DAF  Form Handlers • Form handlers are specialized Nucleus components that can be embedded in our JSPs to do form validation and based on the results do certain actions like inserting into database, forwarding the user to some other JSP page etc., • Using Form Handlers is the way to achieve “Service To Workers” approach of MVC2 design pattern. • DAF comes with a set of ready-made Form handlers like ProfileFormHandler, ShoppingCartModifier etc., that we can use in your pages either directly or customize them using the extension points given. 18

Facilities Supplied by DAF  Repository API • The Repository API (atg.repository.*) is a data access layer that defines a generic representation of a data store. • Whenever ATG applications needs to load, store, or query a data store, they make the appropriate calls through this API. The API then accesses the underlying data storage device, translating the API calls into whatever calls are needed to access that particular data store. 19

• Implementations of the Repository API exist to access data stores such as relational databases, LDAP systems, and content management systems. • In addition, the Composite Repository feature enables us to consolidate multiple data sources and make them available to our application as a single, queryable repository. • The Secured Repository Adapter provides finegrained access control to repository item descriptors, individual repository items, and even individual properties through the use of Access Control Lists (ACLs).

20

Component-centric Development Model

21

• This Framework is totally a component-centric development platform. The Dynamo Web applications you create are assembled out of individual JavaBean components, which are configured and linked together by .properties files within Nucleus, Dynamo’s open object framework. • Nucleus is the core of the entire Dynamo system. It creates and configures Dynamo components (also called beans and JavaBeans) and organizes them into a hierarchical namespace, essentially giving them a place to “live” so they can be referenced by other components. • By reading the .properties files associated with each component, Nucleus figures out which components to use in an application, what their initial properties are, and how they connect to each other. • This model makes it possible for us to build Dynamo applications by configuring pre-built components instead of writing a lot of Java code from scratch. 22

WHAT IS A COMPONENT? • Components are pre-developed pieces of application code that can be assembled into working application systems. • In Short, A Building Block. • A Component Can Be Designed To Manage Simple Functionality Or Even A Very Big Module.. • Components Will Be Put Inside A Construct Called As Container To Make Them Work. The Container Provides the Application Context(or The Environment) And Provides Management And Control Services For These Components. Client Components Will Normally Be A Web Form Or An Applet Whereas Server Components Are Non-visual And Will Be Executed Inside Web Servers ,TP Monitors Etc., • A Component Has To Strictly Adhere To The Standard Component Model. 23

COMPONENT MODEL Component Model: • defines the basic architecture of a component, specifying the structure of its interfaces and the mechanisms by which it interacts with the container and other components. • Provides guidelines to create & implement components that can work together to form a larger application. GUIDELINES Granularity : a component can be very small or even complex. Standard Interface : the component must provide a standard interface that will enable other components to access its properties and methods. Customization without much refactoring : Application developer must be able to change the properties & behaviour of a component without going thro’ its source code. 24

COMPONENT ARCHITECTURE • Practice of delivering solutions by building/buying interoperable components. • Components need not necessarily be objects. They can be any program functionality. • Components can be used for managing GUI functionality or even serverside functionality. 25

COMPONENT ARCHITECTURE EXAMPLES OF COMPONENT ARCHITECTURE • COM/DCOM • JAVA BEANS • CORBA COMPONENTS

26

ADVANTAGES • • • •

27

Code reusability Reduced development time Container independent Entire application behaviour can be changed by modifying one/some of the components (applicable to J2EE)

ADVANTAGES • Makes application development more cost effective by reducing the time to market. • Reusing components improves the quality of the application since the components would have been exhaustively tested and debugged before being released in the market. • Also reusing components means the developers can concentrate on newer areas than doing the same chores. 28

ADVANTAGES • Components will allow you to adapt and reconfigure your work processes and deliverables without requiring wholesale replacement and restructuring of your IT environment. • The use of components enables the continuous, incremental and successful improvements, which quite often yield revolutionary results.

29

What is a component in ATG? • A public java class with appropriate properties with set/get methods. • A acompanying .properties file specifying the class name and the scope and also any default values. • The properties file will also contain any dependency injections of other components. • The .properties file must be under the CONFIGPATH of the ATG. • The name of the component is the full path name of the .properties file under the configpath starting with a “/”. For example, /com/vam/firstbean. • CONFIGPATH variable is computed dynamically during startup based on the modules started, their order of startup and based on the entry in the MANIFEST.MF file of every module started. 30

Dynamo Model Vs. J2EE Original Dynamo Model of Development

31

J2EE Model of development

JHTML with Custom Tags

JSP Pages

Nucleus (Containing Components,repositories etc)

Web Container(Contains Java beans, Tag handlers etc)

JVM (DAS)

JVM (J2EE Application Server)

Operating System

Operating System

DAF Model Today Web Application (JSP) DSP Tag Library

Nucleus (Containing Components,repositories etc)

Web Container JVM (J2EE Application Server) Operating System

32

Design Patterns followed in DAF MVC2 in a Dispatcher View Strategy MVC2 in a Service To Workers Strategy Dependency Injection or IoC (Inversion Of Control

More details about this available in Appendix 33

Separation between page Development and Application Development - the ATG way

34

MAKING JSP EXTENSIBLE • Use Java Beans to separate the Business content from the presentation content and reuse the code. • Define custom tags and a tag library for the oft-used functionalities.

35

JSP Design Basics • Aim in web application design must be to separate logic and presentation. Based on this, there are two approaches to JSP design: • Page-Centric or client-server : in this type, requests are made directly to the JSP page that produces response. • Dispatcher or n-tier : Request is initially made to a JSP or a servlet that acts as a mediator or controller, dispatching requests to a JSP pages and JavaBeans as appropriate. 36

Page-Centric or Client-Server Browser

Request/ response

JSP or servlets client requests are intercepted here

Browser

EJB java beans 37

dB

Characteristics of page-centric design • JSP/servlets access enterprise resources like EJBs directly and generate responses by themselves. • Simple to program and allows the page author to generate the dynamic content easily and based upon the request and state of resources. • But scalability is not there and manageability is difficult because it ends up bundling too much of java code within a JSP page especially if the JSP pages are maintained by the designers. • There are two variants of this model. • Page view • page-view with bean 38

Page view request JSP

Business processing

response

• this approach is easy to get started. • All java code will be embedded within HTML. • Trade-off is as the business logic grows the pages go out of control and also there is very little reusability. 39

Page view with Bean request JSP

Worker Bean

Business processing

response

• this architecture is used when page view becomes too much cluttered with Business logic. • The java code is relegated to a worker bean leaving the JSP clean and maintainable by the designers. • JSP can be modified without affecting the 40 Business logic

• Consequences of the single-page approach – Heavy HTML and Java coupling – The coder of the JSP file must be both a page designer and a Java developer. The result is often either terrible Java code or an ugly page, or sometimes both. – Java and JavaScript blur – As the pages become larger, there can be a tendency to implement some JavaScript. When the JavaScript appears in a page, the script can get confused with the Java code. An example of a possible point of confusion is using client-side JavaScript to validate the email field.

Embedded flow logic – To understand the entire flow of the application, you have to navigate all of the pages. Imagine the spaghetti logic on a 100-page Web site. 41

Debugging difficulties – In addition to being ugly to look at, HTML tags, Java code, and JavaScript code all in one page makes it difficult to debug problems. – Tight coupling – Changes to business logic or data means possibly touching every page involved.

Aesthetics – Visually, in large pages, this type of coding looks messy. When doing Microsoft ASP development, you would commonly see 1000-line pages. Even with syntax coloring, it is still difficult to read and understand. 42

• A JSP tag is simply a way of abstracting out code from a JSP file. Some people think of JSP tags as macros for JSP files, where the code for the tag is contained in the servlet. (The macro perspective is almost true.) we do not want to see HTML tags in Java code, and also Java code in a JSP file. The entire point of JSP technology is to allow the page designer to create servlets without being distracted with Java code. Tags allow Java programmers to extend JSP files by making Java code look like HTML.

43

• JSP tags require a container that runs JSP 1.1 or later. • JSP tags run on the server and are not interpreted by the client like HTML tags are. • JSP tags provide proper code re-use.

44

MVC Architecture MODEL

5. Query the state

Encapsulates application state Responds to state queries Exposes application functionality Notifies views of the changes

1. Register as an observer

3. State change

4. Change notification

VIEW

View

CONTROLLER

Renders the models selection Defines application behaviuor Requests update from models Maps user actions to model updates Sends user gestures to controller Selects view for response 2. User Allow controller to select view

gestures 45

Method calls Events

Model-View-Controller (MVC) • Model – The model encapsulates the state of the application. It knows nothing about the view or controller.

• View – The view provides the presentation of the model. It is the look of the application. The view can access the model getters, but it has no knowledge of the setters. The view should be notified when changes to the model occur.

Controller – The controller reacts to the user input. It creates and sets the model. 46

MVC2 / Model2 • For the Web, the classical form of MVC cannot be applied. So a Web adaptation of MVC, also commonly known as Model 2 or MVC2 has been brought in. • The Web brought some unique challenges to software developers, most notably the stateless connection between the client and the server. This stateless behavior made it difficult for the model to notify the view of changes. On the Web, the browser has to re-query the server to discover modification to the state of the application. 47

MVC2 / Model2 • A JSP or a Servlet will act as a mediator or controller, delegating the requests to other components like JSP or Java Beans. The View will be another JSP. • There are two design patterns that can be followed to apply MVC2 : Mediator-View/Dispatcher-View (a pull based MVC) service to workers (a push based MVC) 48

Dispatcher-View 2. Forward the control

request

Controller

Renders response

Presentation JSP

3. Uses/re-populates 1. populates Simple value Java Beans

49

Worker bean

Business Layer (may Be EJBs)

Dispatcher-View • Mediator works with a presentation JSP page and a worker bean to fulfil a service request. • The mediator initially handles the request and delegates it to a JSP/bean combination. • The presentation JSP populates the bean properties from the request parameters and then uses the bean to prepare the data for presentation.

50

Service To Workers 1.request

5. Returns the presentation JSP name

Controller Servlet

delegate

4.Business call 6.forward

7. response

JSP

2.populate

3.execute

Java bean

3. Uses/re-populates

51

EJBs Business

workers

Layer

db

Service To Workers • The mediating Servlet handles the request from the client. • Initial delegation point is a worker bean that processes our business data and data access code. • After the worker bean has completed its responsibility of populating the intermediate model for the JSP, the mediating component dispatches to the JSP to generate the presentation. • This architecture provides a cleaner separation between the view and the controller 52

IoC or Dependency Injection • Another important benefit of the dynamo framework is that it uses the Dependency Injection or the Inversion of Control design pattern. • This facilitates the developers to concentrate on the business logic coding rather than the infrastructure coding. • The Container is responsible for tying up the necessary components and make it available as and when our application required the same. • Every component will have a dedicated .propeties file to enable the developer to specify the necessary dependencacies.

53

IoC or Dependency Injection • What is it? – A way of sorting out dependencies between objects and automatically “injecting” references to collaborating objects on demand • Who determines how the objects should be injected? – The IoC framework, usually via configuration files • Benefits – Removes the responsibility of finding or creating dependent objects and moves it into configuration – Reduces coupling between implementation objects and encourages interface based design – Allows an application to be reconfigured outside of code – Can encourage writing testable components 54

• Inversion of Control (IoC) is a design pattern that addresses a component's dependency resolution, configuration and lifecycle. • IoC is also relevant to simple classes, not just components. • The most significant aspect to IoC is dependency resolution and most of the discussion surrounding IoC dwells solely on that. • Simply put, a component designed according to IoC does not go off and get other components that it needs in order to do its job. • It instead declares these dependencies, and the container supplies them. Thus the name IoC/DIP/Hollywood Principle. The control of the dependencies for a given component is inverted. • It is no longer the component itself that establishes its own dependencies, but something on the outside. • That something could be a container like dynamo, but could easily be normal code instantiating the component in an embedded sense. 55

Traditional way of obtaining references

… public void service(… ) throws .. { DataSource ds=new InitialContext().lookup(“dynamo:/atg/dyna mo/service/jdbc/MyDS”); Connection conn=ds.getConnection(); …..

56

Dynamo way of obtaining references private DataSource dataSource; public void setDataSource(DataSource ds) { dataSource=ds; //setter Injection } … public void service(… ) throws .. { Connection conn=dataSource.getConnection(); ….. • The .properties file will look like $class=somepkg.someclass

57

dataSource=/atg/dynamo/service/jdbc/sql PoolFakeXA

• Linking Property Values • In a system containing many components, it is not usual for several components to be initialized with the same property values. • If we configure the values independently, this can lead to confusion for the administrator if the value is changed in one component, but not changed in the other components. • So we want the Nucleus to link one property value to the value of another • property in another service. • To do this, append a “^” to the name of the property you want to set. • For the value, enter the component name and property name whose value is to be copied into this property. • For example if there is a second bean whose age property is dependent on firstbean age property, then the properties file of second bean will look like this,where firstbean is a nucleus name relative to secondbean. $class=vam.secondbean age^=firstbean.age • Note : The ^ character must come right after the age name without any intervening white space, otherwise it will not be set. 58

Questions to Ponder? • What is the role of META-INF\MANIFEST.MF in setting up the module dependencies? • What are the steps in creating a component in ATG? • What is the effect of layering the .properties file in ATG? • What is the default location of our java classes in ATG? • What care must be taken when layering .properties file that contain multi-value properties? • What are the various attributes that
View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF