Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Responsible App Tailoring: Creating Effective Architecture with Seams

239 views

Published on

In 10 years of software development, I rarely created or encountered the perfect design. I am continually growing and finding new techniques that constantly evolve my architecture. Seams are places where behavior can be altered without editing any code where the behavior is used. Seams allow the architecture to evolve as the system grows by creating areas that can easily be altered. In this talk, we will cover techniques and patterns to create seams in your architecture. We will start with how classes should interact with one another progressing towards system integrations. Intended for developers of all experiences levels, the techniques learned can be used immediately to effectively create seams in applications.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Responsible App Tailoring: Creating Effective Architecture with Seams

  1. 1. RESPONSIBLE APP TAILORINGCREATING EFFECTIVE ARCHITECTURE WITH SEAMS Jamie Phillips Web: https://phillipsj.net Twitter: @phillipsj73
  2. 2. MERRIAM- WEBSTER' S 1. the joining of two pieces (as of cloth or leather) by sewing usually near the edge 2. the space between adjacent planks or strakes of a ship 3. line, groove, or ridge formed by the abutment of edges 4. a weak or vulnerable area or gap found a seam
  3. 3. Michael Feathers, Working effectively with Legacy Code
  4. 4. Builder Fa�ade Decorator Adapter
  5. 5. public class CPU { public void Freeze() { ... } public void Jump(long position) { ... } public void Execute() { ... } } public class Memory { public void Load(long position, byte[] data) { ... } } public class HardDrive { public byte[] Read(long lba, int size) { ... } }
  6. 6. public class ComputerFacade { private CPU processor; private Memory ram; private HardDrive hd; public ComputerFacade() { this.processor = new CPU(); this.ram = new Memory(); this.hd = new HardDrive(); } public void start() { processor.freeze(); ram.load(BOOT_ADDRESS, hd.read(BOOT_SECTOR, SECTOR_SIZE)); processor.jump(BOOT_ADDRESS); process or.execute(); } }
  7. 7. DI Interface Open Close Liskov Substition
  8. 8. public void Process(MemoryStream stream) { // Do memory stream stuff here. }
  9. 9. public void Process(Stream stream){ // By using stream now you can use any // subtype like MemoryStream, FileStream, // etc. }
  10. 10. MEDIATOR PATTERN
  11. 11. public class Ping : IRequest<string> { }
  12. 12. public class PingHandler : IRequestHandler<Ping, string> { public Task<string> Handle(Ping request, CancellationToken cancellationToken) { return Task.FromResult("Pong"); } }
  13. 13. var response = await mediator.Send(new Ping()); Debug.WriteLine(response); // "Pong"
  14. 14. GATEWAY PATTERN
  15. 15. public interface IMap { string GetLocation(string Address); } public class GoogleMaps : IMap { public string GetLocation(string Address){ // Call google maps } }
  16. 16. API GATEWAY
  17. 17. ENTERPRISE SERVICE BUS
  18. 18. SERVICE ORIENTED ARCHITECTURE
  19. 19. https://docs.microsoft.com/en-us/azure/architecture/guide/architecture-styles/microservices
  20. 20. DATABASE INTEGRATIONS

×