1 / 28

Who are we?

Who are we?. What do we do?. Fulfillment Optimization. How do you decide?. $$. Supply. $. Assignment. Demand. Mmmm … doughnuts NOW!. 6h. 2h. $$. 9h. $. Make me a promise!. Thirsty? I’ll split it with ya. 6h. 2h. $$. 2h. $$$. $. 9h. Additional factors considered.

kamin
Download Presentation

Who are we?

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Who are we?

  2. What do we do? Fulfillment Optimization

  3. How do you decide? $$ Supply $ Assignment Demand

  4. Mmmm… doughnuts NOW! 6h 2h $$ 9h $

  5. Make me a promise!

  6. Thirsty? I’ll split it with ya 6h 2h $$ 2h $$$ $ 9h

  7. Additional factors considered

  8. Java vs. C++

  9. A major difficulty with SOA

  10. Problems with devo • Unstable • Old versions • Co-ordinated changes are hard • Slow • Hard to get support

  11. What does SOA look like? publicclassMyFulfillmentOptimizationService {privateAmazonTransportCostServicetransportationCostService;publicList<Shipment> pickBestShipments(Demanddemand, Supplysupply) {//...doublecost = transportationCostService.calculateShipmentCost(shipment)//...    }} My Service Their Service

  12. Put a layer in-between publicclassMyFulfillmentOptimizationService {privateTransportationCostGatewaytransportationCostGateway;publicList<Shipment> pickBestShipments(Demanddemand, Supplysupply) {//...doublecost = transportationCostGateway.calculateShipmentCost(shipment)//...    }} publicclassAmazonTransportationCostGatewayimplementsTransportationCostGateway {privateAmazonTransportCostServicetransportationCostService;public doublecalculateShipmentCost(Shipmentshipment) {returntransportationCostService.calculateShipmentCost(shipment);    }} publicinterfaceTransportationCostGateway {doublecalculateShipmentCost(Shipmentshipment);} My Service Gateway Their Service

  13. Spy on them! publicclassRecordingTransportationCostGatewayimplementsTransportationCostGateway {privateAmazonTransportCostServicetransportationCostService;privateDataStoragestorage;publicdoublecalculateShipmentCost(Shipmentshipment) {doublereturnValue = transportationCostService.calculateShipmentCost(shipment);storage.store(shipment, returnValue);returnreturnValue;    }} MyService Gateway Storage TheirService Recorder

  14. Eliminate them publicclassReplayTransportationCostGatewayimplementsTransportationCostGateway {DataStoragestorage;publicdoublecalculateShipmentCost(Shipmentshipment) {returnstorage.get(shipment);    }} MyService Gateway TheirService Replay Recorder Storage

  15. Some extra tips • Try hard to use your types in the gateway. Not theirs. • Don’t think about just Services;think of any external dependencies you have. (like a Database). • Don’t get abstract!Until you have to

  16. TDD ?

  17. How I remember things before TDD…

  18. Day 0% Hours 1% Minutes 4% Msec-Second 95%

  19. How can I get more unit tests?

  20. Write Failing Test • Refactor • Code to Pass Test

  21. Common TDD Misconceptions • TDD is just writing tests • Writing the test first • Write TONS of tests before writing any code • Difficult tests represent difficult problems • Bad tests are worse than no tests

  22. Okay, but why is TDD good? • # of Bugs • Failing tests • Documentation / Readability • Self-documenting • Modularity / Extensibility • Dependency Injection, Safety Net • Efficiency (ex. runtime) • Okay maybe TDD doesn’t do this (can it?)

  23. Additional Benefits of TDD • Feedback on “quality” of code • Focus • Debug units, not systems • Safety Net • Speed (controversial) • Shared Code Ownership

  24. TDD pitfalls • I have a legacy system. I can’t write unit tests • Writing tests is hard to do • I don’t understand what tests to write • This is taking too long

  25. If testing is hard… Revisit the design

  26. ?

More Related