tech day 2015 - mikroarkitektur - tar du bussen eller?

14
new TwitterHandler ( "@ pardahlman " ); $ git remote -v > origin https://github.com/pardahlman/ http://pardahlman.se Mikroarkitektur

Upload: valtech-ab

Post on 26-Jul-2015

332 views

Category:

Technology


0 download

TRANSCRIPT

new TwitterHandler("@pardahlman");

$ git remote -v> origin https://github.com/pardahlman/

http://pardahlman.se

Mikroarkitektur

foreach (var item in items){// nothing fishy here

}

// this cannot possible affect anything elseDoStuffOnTheOtherSideOfTheCodeBase();

Monolithic application1

[mɑnəlɪθɪk æpləkeʃən]In software engineering, a monolithic application describes a software application which is designed without modularity. One application to rule them all.

// request customer over httpvar httpClient = new HttpClient("http://example.com/api/v1/");var customer = await httpClient.GetAsync<Apartment>(“apartments/1");

Can phone1

[bərk tɛləfon]Means of communicating through a direct line. Communication is established between two knownparties. Eavesdropping is difficult.

// request apartment over message busvar request = new ApartmentRequest { Id = 1 };var response = await busClient.RequestAsync<ApartmentRequest, ApartmentResponse>(request);

Message bus1

[mɛsədʒ bəs]An infrastructural component that connects applications (typically known as services) in a loosely coupled manner. A message bus specializes in transporting messages between applications.

ApartmentRequest

ApartmentUpdated

ApartmentAvailable

Apartment ServiceApartment Service (offline) Apartment Service

Integrationstester?Boilerplate?

Systemövervakning?

public interface IBusClient : IDisposable{

Task PublishAsync<T>(T message);Task<TResponse> RequestAsync<TRequest, TResponse>(TRequest request)Task SubscribeAsync<T>(Func<T, MessageInformation, Task> subscribe);// more methods here…

}

Integrationstester

Boilerplate

configurator.UseAutofacContainer(container);

Systemövervakning

protected virtual HealthReport GenerateHealthReport(){

var report = _healthFactory.CreateReportFor(this).WithIntegrations(

i => i.ScanConfigurationFile(),i => i.MongoDb("mongoDb"),i => i.SqlDb("slqDb"),i => i.HttpGet("http://elastic.local/")

);return report;

}

<appSettings><add key="DisableHealthReports" value=“false" /><add key="HealthRefreshInterval" value="10000" />

</appSettings>