GithubHelp home page GithubHelp logo

vkscorpio3 / atg-generics Goto Github PK

View Code? Open in Web Editor NEW

This project forked from varelma/atg-generics

0.0 1.0 0.0 4.73 MB

Enables Oracle ATG repositorys to work with Java Generics, allows off heap storage of RepositorItems

License: Apache License 2.0

Java 100.00%

atg-generics's Introduction

atg-generics

Enables Oracle ATG repositorys to work with Java Generics, allows off heap storage of RepositorItems

This is design to be backwardly compatibale with standard ATG repositories. All items that are created are both RepositoryItems and Beans

Key features

  • It offer automatic code generation, of Repository Item wrapper beans
  • Offheap item cacheing, that allows you to scale better
  • Faster performance for in memeory caching
  • Better scaling by using of heap methods for very large number of items

Sample code

Product product = repository.getItem(productId, Product.class);
String description = product.getDescription();
println("1=" + description);

RepositoryItem productRepositoryItem = (RepositoryItem) product;
description = (String)productRepositoryItem.getPropertyValue("description");
println("2=" + description);

Product product = (Product)repository.getItem(productId,"product");
String description = product.getDescription();
println("3=" + description);

RepositoryItem item =   repository.getItem(productId, "product");
description = (String)item.getPropertyValue("description");
println("4=" + description);

Product product1 =  (Product)item ;
String description = product1.getDescription();
println("5=" + description);

Performance

If the item will fit within the JVMs heap without causing excessive GC avtivity that you can set usingMap=true This is appoximatly 6x faster than simple caching.

If you the number of items are to large to fit in the JVMs memory that you can take advantage of the off heap versions, this serialise and deserialise the object, This is similar to the ATG Coherance intergartion, however I beleive that Oracles only stored the key and not that full object loosing some of the potential performance improvement. Some very basic test have show perfomance approximately 3x slower than simple caching however its still faster than going back to the DB. And it can scale to a hugh number of items.

Use

Repository configuration

# /atg/commerce/catalog/ProductCatalog
$class=atg.adapter.gsa.GenericsRepository
dataSource=/atg/commerce/jdbc/ProductCatalogSwitchingDataSource
outputDirectory=/app/oracle/product/atg/ATG/GenericRepository/src
#loggingDebug=true
#loggingTrace=true


#You must uses one of the following storage types usingMap, usingMapDB or usingHazelcast if either of these is not see it will default to using a Map
changeAware=true
#MapDB settings
usingMapDB=true
#Hazelcast settings
#usingHazelcast=true
hazelcastServers=10.0.2.15:5701,10.0.2.15:5702
hazelcastUser=dev
hazelcastPassword=dev-pass

Bean creation

Having configured the your repository as above you need to invoke a the generateAllClasses on the repository

http://localhost:8840/dyn/admin/nucleus/atg/commerce/catalog/ProductCatalog

The code will be generated in the directory outputDirectory

Additional ATG related

https://github.com/varelma/atg-utils

https://github.com/sparkred-insight/atgel

This software was created by Jon Pallas - [email protected]

Varelma

atg-generics's People

Contributors

jonpallas avatar vkscorpio3 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.