Mira Mezini Universität Siegen Dynamic Component Gluing - Runtime Integration of Concerns Dynamic Component Gluing - Runtime Integration of Concerns Linda Seiter Santa Clara University Karl Lieberherr Northeastern University
Question#1: When should a concern be applied? Question#1: When should a concern be applied?
The Java philosophy Class Loading Load a class when you need it, and not beforehand. Why? Keep programs lightweight Performance at program initialization Tailor program model to user‘s profile Class evolution Customer Order Product Static Class Dimension
The SOC philosophy Concern Loading Load a concern when you need it, and not beforehand. Why? Keep classes, objects lightweight Performance at class loading, object construction Tailor class/object model to user‘s profile Dynamic class/object evolution Customer Dynamic Class Dimension Product
Question#2: What should a concern be applied to? Question#2: What should a concern be applied to?
Concern Scope o2:producto1:order OrderProduct Pricing Concern Class Scope Object Scope
Client Order …. //implement LineItem PriceBuilder pricer() { return product(); } Item item() { return product(); } Client client() { return customer(); } (Concern) Pricing Framework PriceBuilderLineItemItemCharge (Base) Application Concern Integration - Regular Pricing OfficeSupply …. //implement Item Charge charge() { return tax(); } //implement PriceBuilder basicPrice(..) { return regPrice(..); } discount(..) { return regDiscount(..); } Customer Tax …. //implement Charge cost(..) { return taxCharge(..); }
Client Order …. //implement LineItem PriceBuilder pricer() { return product(); } Item item() { return product(); } Client client() { return customer(); } Pricing Framework PriceBuilderLineItemItemCharge Application Framework Deployment - Sales Pricing OfficeSupply …. //implement Item Charge charge() { return tax(); } //implement PriceBuilder basicPrice(..) { return salePrice(..); } discount(..) { return saleDiscount(..); } Customer Tax …. //implement Charge cost(..) { return taxCharge(..); }
Client Order …. //implement LineItem PriceBuilder pricer() { return product(); } Item item() { return product(); } Client client() { return customer(); } Pricing Framework PriceBuilderLineItemItemCharge Application Framework Deployment - Negotiated Pricing OfficeSupply …. //implement Item Charge charge() { return tax(); } Customer Tax …. //implement Charge cost(..) { return taxCharge(..); } //implement PriceBuilder basicPrice(..) { return salePrice(..); } discount(..) { return saleDiscount(..); }
Question#3: How to support multi-dimensional classes and objects? Question#3: How to support multi-dimensional classes and objects?
public class AppRoot AppChild appChild(){ return appChild; } public void method_1(AppChild ac) {... } public class AppChild public void method_2() {... } abstract class FrameworkRoot abstract FrameworkChild frameworkChild(); abstract void primOp1(AppChild ) ; public void template() { primOp1(frameworkChild()); frameworkChild().primOp2(); } abstract class FrameworkChild abstract void primOp2(); Solution:Dynamic Composite Adapter FrameworkChild frameworkChild() { return appChild()); } void primOp1(FrameworkChild f) { method_1 ( (AppChild) f); } void primOp2() {method_2 ();} Framework (Concern) Application (Base) appChild
Independently developed binary components dynamic gluing at deployment site: interface matching adaptation new functionality AdapterFactory AdapterObject AdapterUtilities Dynamic Composite Adapter FrameworkRoot FrameworkChild Framework AppRoot AppChild Application APP_FRMK Adapters