Extension points in Enterprise Application

Preview:

DESCRIPTION

Extension points in Enterprise Application, ITDays Cluj-Napoca,

Citation preview

@RaduVunvulea

Extension Points in Enterprise . Applications

{“name” : “Radu Vunvulea,“company” : “iQuest Group”,“userType” : “enthusiastic”“technologies” : [“Azure”, “.NET”, “JS”, “Web”, “Mobile”, “WPF”, “SL” ],“expertise” : [“enterprise”, “pharma”, “automotive”, “home automation”, “e-Commerce” ],“blog” : “vunvulearadu.blogspot.com”,“email” : ”vunvulear@outlook.com”,“socialMedia” :

{“twitter” : “@RaduVunvulea”,

“fb” : “radu.vunvulea”}

}

Who am I?

AgendaWhat are Extension PointsFeatures & IdealEvolutionComponentsService Provider InterfaceWho should implement themCommon Extension PointsConclusion

What are Extension Points

What are Extensions Point?

What are Extensions Point?

What are Extensions Point?• Allows other users to extend the

functionality of the application• Avoid tight coupling between

components• Allow other plugins/components to

customize or extend portions of the functionality

• Define a contract between the two parts

Features & Ideal

Features• Component does not know anything

about other components beyond the scope of the extension contract

• Applications can have more than one component that extend a specific extension point

Ideal• Easy to learn• Support multiple scenarios • Evolve without breaking

existing implementation• Powerful enough to exist more

than one iteration

Evolution

How should evolve• Natural• Based on the needs• Every iteration• At design time

Evolutionpublic class Calculator{

private string baseValue;...public void Add(string value){

if (value==null || value.Count == 0|| value == "-")

{baseValue = baseValue + "-";

}...

}}

Evolutionpublic class Calculator{

private string baseValue;...public void Add(string value){

if (ContainsDefaultValue(value)){

baseValue = baseValue + "-";}...

protected virtual bool ContainsDefaultValue(string value){

return (value==null || value.Count == 0|| value == "-");

}}

How should evolve

NaturalBased on the needs

Every iteratio

n

At design time

Simple Complex

Components

Interfaces

Virtual Methods

Abstract Class

Modules

Services

Configuration Files

…it’s a combination between them…

…no perfect solution…

Interfaces Virtual Methods

Abstract Class Modules

Services Configuration Files

Service Provider Interface

Service Provider Interface (SPI)Contains• Interfaces• Abstract ClassesOptional interfacesAnnotations (attributes)

Interfacespublic class MyCalculator : ICalculator{

public void Add(string value)

{// Some action

}

void Initialize(){

// Some action

}

void Refresh() {}

}

public interface ICalculator{

void Add(string value);

void Initialize();void Refresh();

}

Annotation[InitializeAttribute(typeof(MyInitialize)]public class MyCalculator : ICalculator{

public void Add(string value)

{...

}

void Initialize()void Refresh()

}

public interface ICalculator{

void Add(string value);

void Initialize();void Refresh();

}

Who should implement

Extension Points

External Teams

Print EP

Print EP

Internal Teams

View EP

Core

Core Team

Print EP

Common Extension Points

Common Extension Points

• Manager• Expiration

Policy• Encryption• Backing Store

Caching

• Provider• CRUD• Retry Policy

Data Access

• Hash Algorithm

• Symmetric Encryption

Cryptography 

Common Extension Points• Validator

• Attributes• Handing

Validation

• Formatter• Listeners• Filters

Logging

• Handler• Formatter• Management

Exception

• Authorization

• Authentication

• Security CacheSecurity

Conclusion

Helper FrameworksEnterprise Library (.NET)Java Plugin Framework (Java)Qt Project (C++)BIRT Extension Point (Java BI)

ChangesBe prepared for changes• Frameworks• Services• Hardware• On-premise to Cloud• Cloud to On-premise

Question

Answers

Thank you{ “name” : “Radu Vunvulea, “blog” : “vunvulearadu.blogspot.com”, “email” : ”vunvulear@outlook.com”, “socialMedia” : {

“twitter” : “@RaduVunvulea”,“fb” : “radu.vunvulea”

}}

Recommended