Episode 61 – Software Architecture – Aggregate Roots, Factories, and Repositories
Stitcher is back and so are we as Michael proves he doesn’t have a career as a rapper, Allen can’t type on his phone, and Joe tweets with famous authors as we continue our dive into Domain Driven Design talking about aggregate roots, factories, and repositories. Having a difficult time reading these show notes via your podcast player? Stop by http://www.codingblocks.net/episode61 to read the full show notes. Sponsors FreshBooks.com/Coding – Use code “CODING BLOCKS” in the “How Did You Hear About Us?” section GetAirbrake.com/cb Linode How about you join our Slack Community Already? Join us and the incredible Coding Blocks community by going to http://www.codingblocks.net/slack to become a part of the community. Survey In this episode, we talk about the term “invariant” as it relates to all things programming, and we ask: Did you know what invariant meant? #yop-poll-container-38_yp593f59c67da74 { width: 1000; background:#fff; padding:10px; color:#555; overflow:hidden; font-size:12px; } #yop-poll-container-38_yp593f59c67da74 input[type='text'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; } .yop-poll-name-38_yp593f59c67da74 { font-weight:bold; background:#327BD6; color:#fff; padding:5px; text-align:center; font-size:12px; } #yop-poll-questions-container-38_yp593f59c67da74 { font-size:14px; margin:5px 0px; } .yop-poll-question-container-38_yp593f59c67da74 { padding: 2px; } .yop-poll-question-38_yp593f59c67da74 { background:#327BD6; color:#fff; margin-bottom: 21px; margin-top: -10px; font-style: italic; text-align: center; width: 100%; padding:5px; } .yop-poll-answers-38_yp593f59c67da74 { } .yop-poll-answers-38_yp593f59c67da74 ul { list-style: none outside none; margin: 0; padding: 0; } .yop-poll-li-answer-38_yp593f59c67da74 { font-style:normal; margin:0px 0px 10px 0px; padding:0px; font-size:12px; margin-bottom:20px; } .yop-poll-li-answer-38_yp593f59c67da74 input { margin:0px; float:none; } .yop-poll-li-answer-38_yp593f59c67da74 label { margin:0px; font-style:normal; font-weight:normal; font-size:12px; float:none; } .yop-poll-results-38_yp593f59c67da74 { font-size: 12px; font-style: italic; font-weight: normal; margin-left: 15px; } .yop-poll-customs-38_yp593f59c67da74 { } .yop-poll-customs-38_yp593f59c67da74 ul { list-style: none outside none; margin: 0; padding: 0; } .yop-poll-li-custom-38_yp593f59c67da74 { padding:0px; margin:0px; font-size:14px; } /* Start CAPTCHA div style*/ #yop-poll-captcha-input-div-38_yp593f59c67da74 { margin-top:5px; } #yop-poll-captcha-helpers-div-38_yp593f59c67da74 { width:30px; float:left; margin-left:5px; height:0px; } #yop-poll-captcha-helpers-div-38_yp593f59c67da74 img { margin-bottom:2px; } #yop-poll-captcha-image-div-38_yp593f59c67da74 { margin-bottom:5px; } #yop_poll_captcha_image_38_yp593f59c67da74 { float:left; } /* End CAPTCHA div style*/ .yop-poll-clear-38_yp593f59c67da74 { clear:both; } #yop-poll-vote-38_yp593f59c67da74 { } /* Start Result bar*/ .yop-poll-results-bar-38_yp593f59c67da74 { background:#f5f5f5; height:10px; } .yop-poll-results-bar-38_yp593f59c67da74 div { background:#555; height:10px; } /* End Result bar*/ /* Start Vote Button*/ #yop-poll-vote-38_yp593f59c67da74 div#yop-poll-vote-38_yp593f59c67da74 button { float:left; } #yop-poll-vote-38_yp593f59c67da74 div#yop-poll-results-38_yp593f59c67da74 { float: right; margin-bottom: 20px; margin-top: -20px; width: auto; } #yop-poll-vote-38_yp593f59c67da74 div#yop-poll-results-38_yp593f59c67da74 a { color:#fff; text-decoration:underline; font-size:12px; } #yop-poll-vote-38_yp593f59c67da74 div#yop-poll-back-38_yp593f59c67da74 a { color:#555; text-decoration:underline; font-size:12px; } #yop-poll-vote-38_yp593f59c67da74 div#yop-poll-archive-38_yp593f59c67da74 a { color:#555; text-decoration:underline; font-size:12px; } #yop-poll-vote-38_yp593f59c67da74 div { float:left; width:100%; } /* End Vote Button*/ /* Start Messages*/ #yop-poll-container-error-38_yp593f59c67da74 { font-size:12px; font-style:italic; color:red; text-transform:lowercase; margin-bottom:20px; text-align:center; } #yop-poll-container-success-38_yp593f59c67da74 { font-size:12px; font-style:italic; color:green; margin-bottom:20px; text-align:center; } /* End Messages*/#yop-poll-container-38_yp593f59c67da74 img { max-width: 1000; } .yop-poll-forms-display{} Did you know what invariant meant? Yep. Nope. vote News We love the reviews and appreciate you taking the time to write them! Big thanks to these awesome people. iTunes reviews: Colter Cotten, Conservative Programmer, RWCheese, Shahn H, CCKessler, MarvTheRobot, Alex111132 Stitcher reviews: Rippe, AdamWhitehurst, AllenIsClearlyTheBest, OnlyBavarianBeerIsBeer, clegg89, denifia, GodsShortbus, dubstylee, The Eye of Brows, Edgar da Bunny Azeteg submitted the coolest app to Apple’s App Store: Turbine Dr – Check the operating condition of air-driven turbine-style dental hand tools using _just_ your iPhone’s microphone. Joe tweets Eric Evans. Eric Evans tweeted back. I think open source projects usually focus more narrowly — Eric Evans (@ericevans0) May 26, 2017 Allen is able to type on his phone again thanks to Gboard! (available on Google Play and Apple App Store) Joe tweets Stephen King. Suddenly, rabid dogs and clowns are circling his house. .@StephenKing New book/movie idea for the modern era. Cursed #iphone that subtlety manipulates the text messages for #evil! — CodingBlocks.net (@CodingBlocks) June 10, 2017 Allen hints at an update to his laptop reviews. They’re totally capable of playing a great game of Who’s Your Daddy (Steam) Samsung’s new monitor makes your puny monitor look insignificant. (The Verge, Business Insider, Samsung) Available at Amazon. Coding Blocks Stuff Want some Coding Blocks stuff? Learn more at http://www.codingblocks.net/swag. Lifecycle of Complex Relationships in Domain Driven Design Invariants All constants are invariant, but not all invariants are constant Will always be true at the beginning or end of an iteration Binary tree left node always be greater than any child – Stack Overflow answer. As listed in Domain Driven Design – Chapter 6. pg 128, 1st paragraph “Invariants are consistency rules that must be maintained whenever data changes” Aggregates and Aggregate Roots Aggregate Root – the entry point of an aggregate – where the work should be done – that ensures the integrity of the object graph Aggregate – Cluster of associated objects that we treat as a unit for the purpose of data changes – the graph of objects Objects within an aggregate boundary can reference each other, but not outside the boundary Aggregate roots can reference each other, but not objects not within their boundaries Entities within the aggregate are not accessible outside the boundaries of that aggregate Example of Car as an Aggregate Root…it has tires, a wheel, etc. Car has an identity – think of the VIN – but the tires probably only need to be identified as their position on the car – no external identifier Engines also have unique identifiers, and MIGHT be needed as an aggregate root in some domains, but probably just a part of the car boundary in others Aggregate Root (Entity Root) – global identity and responsible for checking invariants Entities inside the root boundary have only local identities and can only be referenced within the aggregate. The root can pass along a reference from an external entity and hand it down to it’s own entities to be used, but only transiently – they cannot maintain a handle to that external entity Only aggregate roots can be obtained directly with database queries Objects within an aggregate MAY contain references to other aggregate roots Deleting within an aggregate should remove all data at once When data inside the aggregate boundary changes – all invariants on the aggregate must be satisfied Strive to cluster the entities and value objects into aggregates and define the boundaries for each. After you’ve done this, choose one of the aggregates to be your Aggregate Root Purchase orders problem… Many people working on the same PO or many people working on many PO’s referencing items being sold What if part information such as prices change? Lock the parts? Deadlocks What if more than one person is working on a PO at a time? Do you lock it? The Business Approach Parts are used in many PO’s (high contention) There are fewer changes to parts than there are to POs Changes to part prices do not necessarily update the POs…depends on when the price changed in relation to the status of the PO The PO becomes your aggregate root, your line items are entities within the boundary, and the Items themselves are an external aggregate root. Now the PO is responsible for ensuring the invariants / consistency of the data, and locks can be controlled at the PO level Factories and Repositories encapsulate the complexity of some of those life cycle state changes Factories When creating objects or aggregates becomes complicated or revealing – Factory time! “Much of the power of objects rests in the intricate configuration of their internals and their associations. An object should be distilled until nothing remains that does not relate to it’s meaning or support its role in interactions. This mid-life cycle responsibility is plenty. Overlap w/ SOLID and Design Principles In order to create complex objects/aggregates, factories have to know some of the rules about invariants and the business logic…ew Keep that knowledge together in one place, in factories – which have no real meaning to the domain model, but are still part of our design 2 criteria for good factory (including factory methods, like on classes) ALWAYS return an object in a consistent state (atomic and enforce all invariants) Abstract to the TYPE desired, not the class But..where do we put our factory? Factory method on the aggregate root? Factory method on a similar spawner? (Example of creating a Trade Account over a Brokerage Account) Factory class / Depdency Injection (interesting this is the 3rd) Constructor….? But #2…Things you should consider Maybe the class is the type, polymorphism / hierarchy doesn’t matter Maybe the client cares (because that’s who is doing it) cares (like strategy pattern) Are any attrbutes hidden from the client? Is construction simple? Can we assure all invariants are safe? Designing factories Each operation must be atomic – pass everything up front! The factory will be coupled to it’s arguments – so be careful w/ complexity! Stick to abstract/lower levels But what about invariants? Duplicate the logic? Move the logic into the factory? Have the factory delegate it to the product! What about reconstituting stored objects? (deserialization) Do NOT assign a new tracking ID What do you do about invariant failures? Repair it..maybe? Repositories Represents all objects of a certain type as a conceptual set, that acts like a collection, except with more elaborate querying capability Repositories focus on persistence Keep the client focused on the model Retrieves the requested object, encapsulating the machinery to query and map the data Implements a common interface, i.e. the basic CRUD operations Multiple repositories for each type but not necessary each class Using an abstract or base class for example. Repositories may offer many ways to query for a type Use of a Specification-based query improves the flexibility Benefits Allows the client to “talk in intention-revealing” language (Clean Code?) promoting design decisions Promotes Separation of Concerns Enables testability – i.e. repositories could return dummy objects Repositories vs Factories Factories create new objects Repositories find/object objects Repositories can use factories to create objects Factories do not deal with persistence Repositories do deal with persistence Resources We Like Domain-Driven Design Fundamentals by Julie Lerman and Steve Smith (available at Pluralsight) Modern Software Architecture: Domain Models, CQRS, and Event Sourcing by Dino Esposito (available at Pluralsight) Domain Driven Design – Tackling Complexity in the Heart of Software by Eric Evans (available at Amazon) http://DDDCommunity.org http://DomainLanguage.com Tip of the Week SonarQube – an open-source static analysis tool that is easy to plug into your pipeline for continuous code quality. Chrome’s DevTools now provide multiple breakpoints for the same line. See this Stack Overflow answer for an example. LinuxKit – A toolkit for building secure, portable, and lean operating systems for containers Code available on GitHub, read the writeup at Docker. Use the –depth switch to get a shallow clone of a Git repository (docs) git clone –depth 1 … Sharing is Caring Want to help Coding Blocks? Share. Just tell a friend about the show. That’s all we ask. Well, that and a review. /8) Go to http://www.codingblocks.net/review to leave us a review that puts a smile on our faces.
Episode 60 – Software Architecture – The Domain in Domain Driven Design
We continue our Domain Driven Design conversation this week as Allen is indecisive, Michael decides for him, and Joe can’t handle the night life. Using your podcast player to read these notes? Head to http://www.codingblocks.net/episode60 to see the full show notes in all of their glory. Do You Even Slack? If you don’t, you should. Head over to http://www.codingblocks.net/slack to be a part of the conversation. Survey This week we want to know: What is your headphone style of choice while coding? #yop-poll-container-37_yp593f59c6d1041 { width: 1000; background:#fff; padding:10px; color:#555; overflow:hidden; font-size:12px; } #yop-poll-container-37_yp593f59c6d1041 input[type='text'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; } .yop-poll-name-37_yp593f59c6d1041 { font-weight:bold; background:#327BD6; color:#fff; padding:5px; text-align:center; font-size:12px; } #yop-poll-questions-container-37_yp593f59c6d1041 { font-size:14px; margin:5px 0px; } .yop-poll-question-container-37_yp593f59c6d1041 { padding: 2px; } .yop-poll-question-37_yp593f59c6d1041 { background:#327BD6; color:#fff; margin-bottom: 21px; margin-top: -10px; font-style: italic; text-align: center; width: 100%; padding:5px; } .yop-poll-answers-37_yp593f59c6d1041 { } .yop-poll-answers-37_yp593f59c6d1041 ul { list-style: none outside none; margin: 0; padding: 0; } .yop-poll-li-answer-37_yp593f59c6d1041 { font-style:normal; margin:0px 0px 10px 0px; padding:0px; font-size:12px; margin-bottom:20px; } .yop-poll-li-answer-37_yp593f59c6d1041 input { margin:0px; float:none; } .yop-poll-li-answer-37_yp593f59c6d1041 label { margin:0px; font-style:normal; font-weight:normal; font-size:12px; float:none; } .yop-poll-results-37_yp593f59c6d1041 { font-size: 12px; font-style: italic; font-weight: normal; margin-left: 15px; } .yop-poll-customs-37_yp593f59c6d1041 { } .yop-poll-customs-37_yp593f59c6d1041 ul { list-style: none outside none; margin: 0; padding: 0; } .yop-poll-li-custom-37_yp593f59c6d1041 { padding:0px; margin:0px; font-size:14px; } /* Start CAPTCHA div style*/ #yop-poll-captcha-input-div-37_yp593f59c6d1041 { margin-top:5px; } #yop-poll-captcha-helpers-div-37_yp593f59c6d1041 { width:30px; float:left; margin-left:5px; height:0px; } #yop-poll-captcha-helpers-div-37_yp593f59c6d1041 img { margin-bottom:2px; } #yop-poll-captcha-image-div-37_yp593f59c6d1041 { margin-bottom:5px; } #yop_poll_captcha_image_37_yp593f59c6d1041 { float:left; } /* End CAPTCHA div style*/ .yop-poll-clear-37_yp593f59c6d1041 { clear:both; } #yop-poll-vote-37_yp593f59c6d1041 { } /* Start Result bar*/ .yop-poll-results-bar-37_yp593f59c6d1041 { background:#f5f5f5; height:10px; } .yop-poll-results-bar-37_yp593f59c6d1041 div { background:#555; height:10px; } /* End Result bar*/ /* Start Vote Button*/ #yop-poll-vote-37_yp593f59c6d1041 div#yop-poll-vote-37_yp593f59c6d1041 button { float:left; } #yop-poll-vote-37_yp593f59c6d1041 div#yop-poll-results-37_yp593f59c6d1041 { float: right; margin-bottom: 20px; margin-top: -20px; width: auto; } #yop-poll-vote-37_yp593f59c6d1041 div#yop-poll-results-37_yp593f59c6d1041 a { color:#fff; text-decoration:underline; font-size:12px; } #yop-poll-vote-37_yp593f59c6d1041 div#yop-poll-back-37_yp593f59c6d1041 a { color:#555; text-decoration:underline; font-size:12px; } #yop-poll-vote-37_yp593f59c6d1041 div#yop-poll-archive-37_yp593f59c6d1041 a { color:#555; text-decoration:underline; font-size:12px; } #yop-poll-vote-37_yp593f59c6d1041 div { float:left; width:100%; } /* End Vote Button*/ /* Start Messages*/ #yop-poll-container-error-37_yp593f59c6d1041 { font-size:12px; font-style:italic; color:red; text-transform:lowercase; margin-bottom:20px; text-align:center; } #yop-poll-container-success-37_yp593f59c6d1041 { font-size:12px; font-style:italic; color:green; margin-bottom:20px; text-align:center; } /* End Messages*/#yop-poll-container-37_yp593f59c6d1041 img { max-width: 1000; } .yop-poll-forms-display{} What is your headphone style of choice while coding? On-Ear - Great sound in a compact shape Over-Ear - Sweet pillows of sound In-Ear - I need all of the sound in my head Earbuds - Because the pain is worth it vote News Lots of love and thanks to everyone that left a review. We greatly appreciate it. iTunes reviews: ELiktman?ELichtman?’sThat it?, Andreas Risberg, ChrisB777, martinrocket, Hegele, Ashy Lary, TSouza1985, Ilcawthorne, Basicallysteve Stitcher reviews: We’ll never know since Stitcher was down at the time of this recording. However, we will be sure to include those in the next episode. Allen can’t decide which laptop to buy. So he bought both. HP Spectre x360 (available at Amazon) Lenova Yoga (available at Amazon) Oh how the mighty have fallen, MacBook Pro (available at Amazon) Microsoft has the largest Git repo on the planet. Why Google Stores Billions of Lines of Code in a Single Repository. (watch via YouTube, read the article at ACM) Should we have a National Code Forgiveness Day? Kinda like https://emaildebtforgiveness.me/, but for code. Quick and Dirty. Should you do it? Is it wrong? Coding Blocks Gear You need some Coding Blocks stickers in your life. And maybe a shirt. Check out http://www.codingblocks.net/swag to get yours. The Domain in Domain Driven Design Domain Layer Try not to use anemic domain models, which focus on state rather than behavior Do use rich domain models – these focus on behavior, not just the state Should represent concepts of the business Should contain information about the business situation Contains business rules Technical details of storing these things are delegated to the infrasturcture layer….NOT HERE Behaviors are king – “what can you DO” – not what attributes are saved Entities An object that’s not just a bundle of values – must live on – has an identity and are mutable Associating entities – if you can get by with single direction associations, you will GREATLY simplify your life Start with single way associations Shouldn’t have an equals operator? Value Objects Measure, quantify or describe a thing in the domain It’s identity is the composition of it’s values – does not carry an identity field Immutable Compared using a combination of all its values Can’t have side effects Money is a great value object. 100,000 means nothing without a unit – prime candidate for a value object You should strive to use value objects wherever possible rather than entities A time range, as described in the Pluralsight course is a great example as well – a start and an end date – and those may have additional methods Domain Services Important operations that don’t belong to a particular Entity or Value Object Have interfaces defined in terms of other domain model elements Stateless (but may have side effects) Exist in the core of the app A domain service would be responsible for things like processing a payment Resources We Like Domain-Driven Design Fundamentals by Julie Lerman and Steve Smith (available at Pluralsight) Modern Software Architecture: Domain Models, CQRS, and Event Sourcing by Dino Esposito (available at Pluralsight) Domain Driven Design – Tackling Complexity in the Heart of Software by Eric Evans (available at Amazon) http://DDDCommunity.org http://DomainLanguage.com Tip of the Week Want help on your side project? Make it easy for others to help: Put your code on GitHub. Create a README with instructions on how to build and run the project. If it’s trivial, then it will be trivial to document. Create an issue describing the issue as “help wanted” Assign the issue to Joe. /8) Think you know PowerShell? Check out how Mike F Robbins gets our feed. Remarkable – Markdown parser, done right (available on GitHub). Format your JSON with ease: https://jsonformatter.org/ https://jsonformatter.curiousconcept.com/ Spread the Word Do you know how you can help us? Tell someone about the show. That’s it. It’s that easy. And, we’d appreciate it. Super appreciate it. And if you haven’t already, head to http://www.codingblocks.net/review to leave us a review. The world needs to hear your opinion.
Episode 59 – How to Jumpstart Your Next App
We’re back with another exciting episode as Michael questions Hollywood, Allen dreams of his Hackintosh, and Joe is surrounded by Star Wars as we talk about how to jumpstart your next app with Michael Crump (@mbcrump) and Clint Rutkas (@clintrutkas). If you’re reading these show notes via your podcast player, you can find this episode’s full show notes at http://www.codingblocks.net/episode59. Join us on Slack Like to talk to like-minded developers? You should join our Slack community. Head to http://www.codingblocks.net/slack to become a part of the conversation today. Survey In this episode, we ask: How cool is your company? #yop-poll-container-36_yp593f59c743b54 { width: 1000; background:#fff; padding:10px; color:#555; overflow:hidden; font-size:12px; } #yop-poll-container-36_yp593f59c743b54 input[type='text'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; } .yop-poll-name-36_yp593f59c743b54 { font-weight:bold; background:#327BD6; color:#fff; padding:5px; text-align:center; font-size:12px; } #yop-poll-questions-container-36_yp593f59c743b54 { font-size:14px; margin:5px 0px; } .yop-poll-question-container-36_yp593f59c743b54 { padding: 2px; } .yop-poll-question-36_yp593f59c743b54 { background:#327BD6; color:#fff; margin-bottom: 21px; margin-top: -10px; font-style: italic; text-align: center; width: 100%; padding:5px; } .yop-poll-answers-36_yp593f59c743b54 { } .yop-poll-answers-36_yp593f59c743b54 ul { list-style: none outside none; margin: 0; padding: 0; } .yop-poll-li-answer-36_yp593f59c743b54 { font-style:normal; margin:0px 0px 10px 0px; padding:0px; font-size:12px; margin-bottom:20px; } .yop-poll-li-answer-36_yp593f59c743b54 input { margin:0px; float:none; } .yop-poll-li-answer-36_yp593f59c743b54 label { margin:0px; font-style:normal; font-weight:normal; font-size:12px; float:none; } .yop-poll-results-36_yp593f59c743b54 { font-size: 12px; font-style: italic; font-weight: normal; margin-left: 15px; } .yop-poll-customs-36_yp593f59c743b54 { } .yop-poll-customs-36_yp593f59c743b54 ul { list-style: none outside none; margin: 0; padding: 0; } .yop-poll-li-custom-36_yp593f59c743b54 { padding:0px; margin:0px; font-size:14px; } /* Start CAPTCHA div style*/ #yop-poll-captcha-input-div-36_yp593f59c743b54 { margin-top:5px; } #yop-poll-captcha-helpers-div-36_yp593f59c743b54 { width:30px; float:left; margin-left:5px; height:0px; } #yop-poll-captcha-helpers-div-36_yp593f59c743b54 img { margin-bottom:2px; } #yop-poll-captcha-image-div-36_yp593f59c743b54 { margin-bottom:5px; } #yop_poll_captcha_image_36_yp593f59c743b54 { float:left; } /* End CAPTCHA div style*/ .yop-poll-clear-36_yp593f59c743b54 { clear:both; } #yop-poll-vote-36_yp593f59c743b54 { } /* Start Result bar*/ .yop-poll-results-bar-36_yp593f59c743b54 { background:#f5f5f5; height:10px; } .yop-poll-results-bar-36_yp593f59c743b54 div { background:#555; height:10px; } /* End Result bar*/ /* Start Vote Button*/ #yop-poll-vote-36_yp593f59c743b54 div#yop-poll-vote-36_yp593f59c743b54 button { float:left; } #yop-poll-vote-36_yp593f59c743b54 div#yop-poll-results-36_yp593f59c743b54 { float: right; margin-bottom: 20px; margin-top: -20px; width: auto; } #yop-poll-vote-36_yp593f59c743b54 div#yop-poll-results-36_yp593f59c743b54 a { color:#fff; text-decoration:underline; font-size:12px; } #yop-poll-vote-36_yp593f59c743b54 div#yop-poll-back-36_yp593f59c743b54 a { color:#555; text-decoration:underline; font-size:12px; } #yop-poll-vote-36_yp593f59c743b54 div#yop-poll-archive-36_yp593f59c743b54 a { color:#555; text-decoration:underline; font-size:12px; } #yop-poll-vote-36_yp593f59c743b54 div { float:left; width:100%; } /* End Vote Button*/ /* Start Messages*/ #yop-poll-container-error-36_yp593f59c743b54 { font-size:12px; font-style:italic; color:red; text-transform:lowercase; margin-bottom:20px; text-align:center; } #yop-poll-container-success-36_yp593f59c743b54 { font-size:12px; font-style:italic; color:green; margin-bottom:20px; text-align:center; } /* End Messages*/#yop-poll-container-36_yp593f59c743b54 img { max-width: 1000; } .yop-poll-forms-display{} How cool is your company? Extremely cool! They pay for my conferences! Very cool. They give me time off for conferences. They suck. I'm lucky if I get my time off approved. vote Sign up for a free 30-day trial for a chance to win a $500 Amazon gift card at GetAirbrake.com/cb. News Super duper big thanks to those that gave us a review! We really appreciate it. iTunes reviews: gespiton, Elsint, dreed44, Skerovs, jbourne33 Stitcher reviews: tapan, The_DuGg, Mosquitobite, TimB, Yellow Snowman, skerovs, atnewton, ArnabaldoCirnebaldeSchifi Why does Hollywood insist on portraying programming/hacking like two gunfighter’s in a showdown at high noon? 2 unit tests. 0 integration tests: 2 unit tests. 0 integration tests pic.twitter.com/V2Z9F4G1sJ — The Practical Dev (@ThePracticalDev) January 14, 2016 @ThePracticalDev @testobsessed pic.twitter.com/uKvhzoEPF7 — George Dinwiddie (@gdinwiddie) January 23, 2016 2 unit tests. 0 integration tests. pic.twitter.com/FpForNhhyi — The Practical Dev (@ThePracticalDev) March 25, 2017 NVIDIA Pascal drivers make your Hackintosh that much better. What if we tried designing C a second time? (via Reddit) Want a Coding Blocks Shirt? Be the first on your block to have the coolest Coding Blocks gear available. Go to http://www.codingblocks.net/swag to get yourself some t-shirts and stickers! Jumpstart Your Next App with UWP and WTS What is UWP? UWP, or more specifically, the Universal Windows Platform, allows you to develop your app using one API, submit that app package to the Windows store, and reach all Windows 10 devices. PCs, tablets/phones, Xbox, etc. Using UWP, your app will get some freebies like a clean install/uninstall, a responsive design, and the AppX packaging format. Microsoft announced the WTS, Windows Template Studio, at Build 2017. So what is WTS? WTS provides a new File -> New UWP app experience. Go from File -> New to F5 running a working application in minutes. WTS scaffolds common features (assuming you select the appropriate options) like: Navigation structure: Navigation Pane Pivot and Tabs Framework: Code Behind MVVM Light MVVM Basic Pages and App Lifecycle Features: Map Master/Detail Settings Theming Tabbed Web View Background Tasks Settings Storage Suspend and Resume Generated code adheres to best practices for the given option/framework. Localization ready. WTS is open source (GitHub). Create your own custom templates. Getting started by following the instructions on GitHub. Download Visual Studio 2017 Install the WTS extension Select File -> New Project -> C# -> Windows Universal – Windows Template Studio. Go from … to … in minutes. Watch Joe create a UWP app with Windows Template Studio and iPodcastSearch: Resources We Like Microsoft /BUILD 2017 Windows Template Studio GitHub repo Visual Studio Extenstion Tip of the Week How to Convince Your Boss to Send You to a Conference (Inc.) Use CONCAT in your T-SQL instead of the ‘+’ character Use Git Extras to add all of the commands you wish Git came with. Tell Your Friends How would you like to do us a favor? A simple, easy favor. Tell a friend about the show. We’ll be forever grateful if you do, as will your friend. And while you’re in the giving mood, if you haven’t already left us a review, we’d really appreciate it. Go to http://www.codingblocks.net/review to let everyone hear your voice.
Episode 58 – Why Domain Driven Design
This week, Michael asks his customers about their anemic domain model, Allen talks in front of people, and Joe plays Rocket League as we begin our dive into understanding domain driven design. Are you reading this episode’s show notes via your podcast player? You can find this episode’s full show notes at http://www.codingblocks.net/episode58. Become a Part of the Community Care to join in on the conversation? Join the conversation in the Slack community by heading over to http://www.codingblocks.net/slack to join today. Survey This week, we ask: Which (programming) language are you most envious of? #yop-poll-container-35_yp593f59c7ba349 { width: 1000; background:#fff; padding:10px; color:#555; overflow:hidden; font-size:12px; } #yop-poll-container-35_yp593f59c7ba349 input[type='text'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; } .yop-poll-name-35_yp593f59c7ba349 { font-weight:bold; background:#327BD6; color:#fff; padding:5px; text-align:center; font-size:12px; } #yop-poll-questions-container-35_yp593f59c7ba349 { font-size:14px; margin:5px 0px; } .yop-poll-question-container-35_yp593f59c7ba349 { padding: 2px; } .yop-poll-question-35_yp593f59c7ba349 { background:#327BD6; color:#fff; margin-bottom: 21px; margin-top: -10px; font-style: italic; text-align: center; width: 100%; padding:5px; } .yop-poll-answers-35_yp593f59c7ba349 { } .yop-poll-answers-35_yp593f59c7ba349 ul { list-style: none outside none; margin: 0; padding: 0; } .yop-poll-li-answer-35_yp593f59c7ba349 { font-style:normal; margin:0px 0px 10px 0px; padding:0px; font-size:12px; margin-bottom:20px; } .yop-poll-li-answer-35_yp593f59c7ba349 input { margin:0px; float:none; } .yop-poll-li-answer-35_yp593f59c7ba349 label { margin:0px; font-style:normal; font-weight:normal; font-size:12px; float:none; } .yop-poll-results-35_yp593f59c7ba349 { font-size: 12px; font-style: italic; font-weight: normal; margin-left: 15px; } .yop-poll-customs-35_yp593f59c7ba349 { } .yop-poll-customs-35_yp593f59c7ba349 ul { list-style: none outside none; margin: 0; padding: 0; } .yop-poll-li-custom-35_yp593f59c7ba349 { padding:0px; margin:0px; font-size:14px; } /* Start CAPTCHA div style*/ #yop-poll-captcha-input-div-35_yp593f59c7ba349 { margin-top:5px; } #yop-poll-captcha-helpers-div-35_yp593f59c7ba349 { width:30px; float:left; margin-left:5px; height:0px; } #yop-poll-captcha-helpers-div-35_yp593f59c7ba349 img { margin-bottom:2px; } #yop-poll-captcha-image-div-35_yp593f59c7ba349 { margin-bottom:5px; } #yop_poll_captcha_image_35_yp593f59c7ba349 { float:left; } /* End CAPTCHA div style*/ .yop-poll-clear-35_yp593f59c7ba349 { clear:both; } #yop-poll-vote-35_yp593f59c7ba349 { } /* Start Result bar*/ .yop-poll-results-bar-35_yp593f59c7ba349 { background:#f5f5f5; height:10px; } .yop-poll-results-bar-35_yp593f59c7ba349 div { background:#555; height:10px; } /* End Result bar*/ /* Start Vote Button*/ #yop-poll-vote-35_yp593f59c7ba349 div#yop-poll-vote-35_yp593f59c7ba349 button { float:left; } #yop-poll-vote-35_yp593f59c7ba349 div#yop-poll-results-35_yp593f59c7ba349 { float: right; margin-bottom: 20px; margin-top: -20px; width: auto; } #yop-poll-vote-35_yp593f59c7ba349 div#yop-poll-results-35_yp593f59c7ba349 a { color:#fff; text-decoration:underline; font-size:12px; } #yop-poll-vote-35_yp593f59c7ba349 div#yop-poll-back-35_yp593f59c7ba349 a { color:#555; text-decoration:underline; font-size:12px; } #yop-poll-vote-35_yp593f59c7ba349 div#yop-poll-archive-35_yp593f59c7ba349 a { color:#555; text-decoration:underline; font-size:12px; } #yop-poll-vote-35_yp593f59c7ba349 div { float:left; width:100%; } /* End Vote Button*/ /* Start Messages*/ #yop-poll-container-error-35_yp593f59c7ba349 { font-size:12px; font-style:italic; color:red; text-transform:lowercase; margin-bottom:20px; text-align:center; } #yop-poll-container-success-35_yp593f59c7ba349 { font-size:12px; font-style:italic; color:green; margin-bottom:20px; text-align:center; } /* End Messages*/#yop-poll-container-35_yp593f59c7ba349 img { max-width: 1000; } .yop-poll-forms-display{} Which (programming) language are you most envious of? C C# C++ F# Go Haskell Java JavaScript Python R Ruby Swift Typescript VB.NET vote Sign up for a free 30-day trial for a chance to win a $500 Amazon gift card at GetAirbrake.com/cb. News Thank you to everyone that left us a review! It really means a lot to us. iTunes reviews: tumoxe, drkaj, rumberger_, robbydiesal, heberej, Caffeine Slayer, ArgggGamer, gbmillard, Bob Minteer, wpdevguy, SanJustoEs, Tokachu, Mordef, DK4501, RCF9, ABSquaredX, Shenril, D***qAllTehNICKNAMEZtaken, ze durham, LucasandRico Stitcher reviews: JoeZacksBeard, MrE DBA, MoJoRisin, topswagcode, Joshua Kaluba, tackaman, Cruz, ssfcultra Top 10 things which make programmers unhappy at MyBroadband. A brief summary of this academic paper. nate_the_dba points out: Don’t use Allen’s SQL debugging Tip-of-the-Week in production as it can lock tables. (Or use it carefully.) And Michael asks, why are you debugging in production? Allen gives a presentation on Serverless Architecture (YouTube, Meetup). Unfortunately, he felt a bit uneasy following an extremely well polished presentation on JavaScript Everywhere (YouTube). Facebook announces React Fiber (TechCrunch) OMG, we’re already at Angular 4.0 (Blogspot) Joe moved to Orlando! So many more Meetups to attend. Joe attended the Orlando Code Camp. Swag I know, I know, your swagger game is tight. But, and hear me out, it could be better. Check out http://www.codingblocks.net/swag for more information on how to get some of your favorite Coding Blocks stickers and t-shirts. Domain Driven Design (DDD) Why Domain Driven Design What is the “domain”? Set of principles and patterns to solve difficult problems Clear and testable code that represents the domain Interact with domain experts In contrast to some approaches, you focus on a single domain at a time Business logic is in one area Drawbacks? Need access to the domain experts Time and effort, initially, much higher Have to really think about how to isolate domain logic from other portions of your application Learning curve – as with any new framework / pattern No reason to do it in place of a simple crud app – if there’s not complex business domains to manage, this is overkill Gotta get buy in from upper management Is DDD anti-agile? http://stackoverflow.com/questions/39245741/what-makes-domain-driven-design-worthwhile Ubiquitous Language One of the most important aspects of DDD “Client” means something totally different to a UI developer vs a domain expert working with customers Common vocabulary MUST be established – and all communications should be carried out with that vocabulary Need to focus on how the domain works – nothing regarding implementation details Getting into the details…a bit Bounded context – specific responsibility with explicit boundaries that separate it from other parts of a system “Explicitly define the context within which a model applies…Keep the model strictly consistent within these bounds, but don’t be distracted or confused by issues outside” – Eric Evans Terms: Problem domain – the specific problem you’re working on solving Core domain – key to the customer’s business – cannot be outsourced Sub domain – separate pieces your software must interact with Context mapping – identifying bounded contexts and their relationships to one another Shared kernel – part of the model that is shared by more than one team – will not change without collaboration between teams Resources We Like Domain-Driven Design Fundamentals by Julie Lerman and Steve Smith (available at Pluralsight) Modern Software Architecture: Domain Models, CQRS, and Event Sourcing by Dino Esposito (available at Pluralsight) Domain Driven Design – Tackling Complexity in the Heart of Software by Eric Evans (available at Amazon) http://DDDCommunity.org http://DomainLanguage.com Tip of the Week http://voicecode.io/ – Write code using only your voice http://surge.sh – Publish your site from the command line Function Apps in Azure Just when we thought https://regex101.com/ was the greatest site to be added to the Internet, Matthew Watkins writes in to inform us of http://refiddle.com/ and (his favorite) http://www.regexr.com/. Thanks Matthew! Share With a Friend Would you like to help us? You can. And it’s easy. Share Coding Blocks with a friend. See. Now wasn’t that easy? And what’s even better, now your friend knows that you’re a genius. So, win-win right? And hey, there’s one last way you can help us. How’s that you ask? Simply leave us a review. Head to http://www.codingblocks.net/review to tell the world about us.
Episode 57 – How We Badly Built Stuff
This week we talk about all of the bad things we’ve done while making software. The good, the bad, … oh wait, it compiles, never mind. Want to be part of the conversation? Head over to http://www.codingblocks.net/slack to become a member of our Slack community! What are you waiting for? Join now! Oh, wait, are you viewing these show notes via your podcast player? Then head to http://www.codingblocks.net/episode57 to find this episode’s full show notes. Airbrake Contest Big thanks to Airbrake.io for sponsoring this episode. Airbrake provides a full stack error monitoring tool that alerts you to errors in your software, then helps you diagnose and fix them. Sign up for a free 30-day trial for a chance to win a $500 Amazon gift card at GetAirbrake.com/cb. Survey This episode’s survey asks: How fast is your _personal_ Internet connection? #yop-poll-container-34_yp593f59c8cda9f { width: 1000; background:#fff; padding:10px; color:#555; overflow:hidden; font-size:12px; } #yop-poll-container-34_yp593f59c8cda9f input[type='text'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; } .yop-poll-name-34_yp593f59c8cda9f { font-weight:bold; background:#327BD6; color:#fff; padding:5px; text-align:center; font-size:12px; } #yop-poll-questions-container-34_yp593f59c8cda9f { font-size:14px; margin:5px 0px; } .yop-poll-question-container-34_yp593f59c8cda9f { padding: 2px; } .yop-poll-question-34_yp593f59c8cda9f { background:#327BD6; color:#fff; margin-bottom: 21px; margin-top: -10px; font-style: italic; text-align: center; width: 100%; padding:5px; } .yop-poll-answers-34_yp593f59c8cda9f { } .yop-poll-answers-34_yp593f59c8cda9f ul { list-style: none outside none; margin: 0; padding: 0; } .yop-poll-li-answer-34_yp593f59c8cda9f { font-style:normal; margin:0px 0px 10px 0px; padding:0px; font-size:12px; margin-bottom:20px; } .yop-poll-li-answer-34_yp593f59c8cda9f input { margin:0px; float:none; } .yop-poll-li-answer-34_yp593f59c8cda9f label { margin:0px; font-style:normal; font-weight:normal; font-size:12px; float:none; } .yop-poll-results-34_yp593f59c8cda9f { font-size: 12px; font-style: italic; font-weight: normal; margin-left: 15px; } .yop-poll-customs-34_yp593f59c8cda9f { } .yop-poll-customs-34_yp593f59c8cda9f ul { list-style: none outside none; margin: 0; padding: 0; } .yop-poll-li-custom-34_yp593f59c8cda9f { padding:0px; margin:0px; font-size:14px; } /* Start CAPTCHA div style*/ #yop-poll-captcha-input-div-34_yp593f59c8cda9f { margin-top:5px; } #yop-poll-captcha-helpers-div-34_yp593f59c8cda9f { width:30px; float:left; margin-left:5px; height:0px; } #yop-poll-captcha-helpers-div-34_yp593f59c8cda9f img { margin-bottom:2px; } #yop-poll-captcha-image-div-34_yp593f59c8cda9f { margin-bottom:5px; } #yop_poll_captcha_image_34_yp593f59c8cda9f { float:left; } /* End CAPTCHA div style*/ .yop-poll-clear-34_yp593f59c8cda9f { clear:both; } #yop-poll-vote-34_yp593f59c8cda9f { } /* Start Result bar*/ .yop-poll-results-bar-34_yp593f59c8cda9f { background:#f5f5f5; height:10px; } .yop-poll-results-bar-34_yp593f59c8cda9f div { background:#555; height:10px; } /* End Result bar*/ /* Start Vote Button*/ #yop-poll-vote-34_yp593f59c8cda9f div#yop-poll-vote-34_yp593f59c8cda9f button { float:left; } #yop-poll-vote-34_yp593f59c8cda9f div#yop-poll-results-34_yp593f59c8cda9f { float: right; margin-bottom: 20px; margin-top: -20px; width: auto; } #yop-poll-vote-34_yp593f59c8cda9f div#yop-poll-results-34_yp593f59c8cda9f a { color:#fff; text-decoration:underline; font-size:12px; } #yop-poll-vote-34_yp593f59c8cda9f div#yop-poll-back-34_yp593f59c8cda9f a { color:#555; text-decoration:underline; font-size:12px; } #yop-poll-vote-34_yp593f59c8cda9f div#yop-poll-archive-34_yp593f59c8cda9f a { color:#555; text-decoration:underline; font-size:12px; } #yop-poll-vote-34_yp593f59c8cda9f div { float:left; width:100%; } /* End Vote Button*/ /* Start Messages*/ #yop-poll-container-error-34_yp593f59c8cda9f { font-size:12px; font-style:italic; color:red; text-transform:lowercase; margin-bottom:20px; text-align:center; } #yop-poll-container-success-34_yp593f59c8cda9f { font-size:12px; font-style:italic; color:green; margin-bottom:20px; text-align:center; } /* End Messages*/#yop-poll-container-34_yp593f59c8cda9f img { max-width: 1000; } .yop-poll-forms-display{} How fast is your _personal_ Internet connection? Less than 5 Mbps (I