BrandGhost

How Baking Cakes Can Improve Your Software Development

In software development, it's very common to have software architecture done in layers. It's something that has been done for ages in teams of all sizes in every different domain... But is there a way that we can focus our feature development process to be more optimal, despite the idea of layers existing? And what does this have to do with cake?! For more videos on programming with detailed examples, check this out: https://www.youtube.com/playlist?list=PLzATctVhnsghN6XlmOvRzwh4JSpkRkj2T Have...
View Transcript
all right so you're probably wondering what the heck software development and Cake could possibly have in common well aside from the fact that both take time to put together and if you're trained in either of these you can actually make better cakes or better software there's actually something else it's kind of interesting in terms of software development and architecture that we can learn from cake and no I'll be totally up front I'm not about to reveal to you how you can write programs that are delicious so if you figure that out please let me know but instead we're going to look at something called vertical slices this is actually a topic that I discussed recently in my video on plug-in architecture and I had messages come in about what vertical slices actually were and if I can make more content explaining that so let's jump right in and see how cake might actually transform the way that you write your software okay so many of us have heard about this traditional approach to software architecture which is like a layered architecture and that's where you're going to have things like a database layer that might sit at the bottom you'll have business logic that sits on top of that and then perhaps you'll have like your use user interface on top of that and the different layers that you have in this architecture can look very different depending on the application you're building and the technology choices it's not always going to be exactly three layers you know it could be a combination of a couple of other things going on and Technology choices might make that a little bit different but overall this is this kind of concept that you have where you have these different layers that represent different parts of the application now the layers when we're talking about a layered architecture we're visualizing them horizontally I'll show some diagrams shortly so these horizontal layers and the way to think about that is that these are actually like technology or functional layers and not actually like features so layered architectures don't have a layer that is the feature that enables a user to perform thing x a layer in a layered architecture might have the database access that allows that feature to be enabled but being able to actually have that feature fully integrated probably requires a bunch of these different layers actually up and running and working together so when we're talking about layered architectures this is actually a software architectural pattern and we are thinking about them horizontally now if we're talking about vertical slices vertical slices aren't actually an architectural pattern they're more of a software development approach and if you're using your imagination already you're probably thinking okay he's talking about layered architectures being horizontal a vertical slice as the name suggests is a slice vertically through these different layers so the concept with a vertical slice is that it allows us to focus on delivering a feature from end to end having all the functionality and that will mean that it needs something like say a user interface for a user to interact with some sort of business logic that might be at a lower layer and then something like perhaps a data layer obviously it's situational but that would be sort of this third layer but the vertical slice has to span through all three of these layers in order for your functionality to be be introduced and that was just three layers in this example but if you get the idea the vertical slice spans the different layers of your layered architecture all right but it wouldn't be a vertical slice video if we didn't talk about cake a little bit more so let's pull up Google and actually start looking what the internet says about vertical slices all right so I've just done a quick little Google search here for vertical slice and software development and you can see that I didn't even include anything about cake in my search but behold we already have a few things right at the top demonstrating this with cake so even this picture right here let me open that up to make it a little bit bigger so you can see that it's saying each slice is functionality across all layers right so we have this cake and they're talking about the layers of the cake representing like I was just talking about sort of these different functional areas so something like a database or a domain so your business logic and stuff like that and then a user interface up top unfortunately some of these pictures are kind of low resolution but this is another one that does not use cake to kind of illustrate straight the same thing and you can see that they're saying a presentation layer business logic and then having this data layer here and all of these are the horizontal slices so again a layered architecture kind of building these layers up and then the vertical slice is going to be some type of feature that you deliver that has to kind of work through all of these layers I also just want to mention too that you don't actually have to have necessarily something like a layered architecture in order to talk about vertical slices because the concept of a vertical slice is really just that you're thinking about delivering a feature end to end so thinking about it sort of in isolation what technology or what things do you need to enable in order for that feature to actually work and when we use a layered architecture that has horizontals it's a nice contrast and you get these visuals like with cakes and things like that that can really help illustrate that when you're trying to tackle just a narrow feature it will have to span a bunch of different things and that might be at odds with what some software development teams do if they're focused and group together on looking at the different layers so for example if you had a software development team or multiple teams and part of an organization and you might have a team that's focused on the data layer right so they're doing all of the work interacting with the database and things like that you might have some other teams that are focused on like a business logic layer maybe that's something that you could break up and have different sets of business logic across different teams but they kind of focus in this one layer and then you might have another team that's like the front end team right and depending on the product or products or Services you have maybe you have some dedicated teams for that as well but if you think about it those were examples of kind of focusing in layers in different functional areas and I'm not saying there's anything wrong with that it's going to be situational if an organization finds that they can operate effectively like that then great that's cool but this vertical slice approach is kind of at odds with that approach because instead of looking at things just in the horizontal players and having individuals dedicated to like I'm just going to work on the data layer you actually have to think about delivering a feature end to end and spanning these layers we'll just look at one more example here because this is an awesome picture of cake and a nice little drawing that has a really good visual about delivering features sort of through these horizontal layers so let's start with the horizontal layers right they say web UI so that's like our presentation layer we've been talking about we have this uh this middleware and then data layer as well so again let's think about like a web application you're gonna have a web UI and then you're gonna have this web service running with a database and things like that so these are the different architectural pieces that you would have in your web server and if you look at the other slices like literal slices that they're showing coming out of this cake we have what you would consider different functionality that an end user could have so the one slice that's coming out of the cake that you can see being cut out here says pay order with credit card right if you look at the other slices that they have they have pay order with PayPal right so the idea here is that these are literally different sets of functionality that a user could have and the user isn't going to be thinking about the different you know horizontal layers that are in this cake or in the software architecture it's really just focused about the actual feature and the other part here is that they have uh pay manually so again like just another type of payment method that you could have and all of these are three distinct features and if you think about it they probably all have to span like you know the web UI to be able to have the user interact with it the layers below that might look a little bit different in terms of what they're touching right so I can't obviously this is not a full like software architecture here but the middleware we might have to interact with different services from there right the data layer depending on the types of transactions and how that's all working maybe that's going out to different database tables and things like that so the what's happening underneath the hood sort of when you're carving out that vertical slice in those layers you might be touching different things but the idea is again you're cutting a vertical slice through them all right let's just briefly touch on some of the reasons why you might want to take a vertical slice approach in your software development so some would argue that you actually get a faster feedback loop when you focus on this kind of thing and you're thinking about building software and if you're doing it in layers and trying to have these really robust fully built out horizontal layers before you can actually deliver functionality it makes it kind of tricky because you actually have to go establish everything in its entirety or you're focused on perhaps delivering a little bit too much it's not really scoped when you're just focusing on the layer so you might say well we have all these tables we're going to have to go make like let's go build the Repository razor like if you're using Entity framework let's get all the entities and stuff set up but the reality is for this feature that you're trying to focus on if you're thinking about a vertical slice it might only need a very narrow set and if you just focus on that you can actually carve out the necessary time just for that and not everything else and if you kind of take this same concept and apply to the different layers it really lets you just kind of focus on what's actually needed for just this feature and then of course by doing that reducing the amount of time it actually takes to have something working end to end even if it's not bulletproof and perfect you can actually get feedback on it sooner right so someone can try it whether that's you know developers internally QA testers if you're working with customers that can actually try it out that kind of thing you can get that feedback kind of measure and then adjust to see okay like what else do we need to do to make this actually work the way we want another interesting thing about this is improve collaboration so one thing that I really like to think about is that when you have software teams it's pretty natural that people will gravitate towards things that they feel like they have strengths in right so for example I'm not a good front-end developer I really have a challenge with trying to take creative ideas and making them appear the way that I would like but I get Concepts around usability and you know good design practices I think so I'm okay with that but I'm really bad at like Translating that into um into actuality I suppose but when it comes to back end stuff I feel like I I do a lot better with that and if you think about other people on teams that you've worked with you'll probably notice that some people gravitate towards different things of course there's lots of people that can do all of it end to end and that's great but sometimes people will focus on like you know I like this or I'm better at it so you get this mix of people on a team that have different skill sets and that kind of thing so when you're doing vertical slices what's really cool is that you can actually get collaboration within an entire team so that you're not not just having the database people only do the database stuff and the front-end people only do the front end stuff you can actually work on features end to end and you can kind of consult with these people on your team that are more like the experts and that kind of thing so as you're working through stuff so say for me like if I'm more of a back-end person if I had to do this feature and it required some front-end work I could start working on that and pull over someone from my team and say hey by the way I'm starting this part up could I get your feedback about the best spot to integrate this and all of a sudden you start to get this like really collaborative effect within a team and I think that that kind of approach actually like can really transform a team building trust building respect and kind of just bringing down silos right and a lot of people end up Skilling up a ton when they can do this kind of thing instead of just getting like I'm really good at database queries or I'm really good at making uis but if I had to touch anything in the database case I would I would lose it and a third thing that I want to call out for vertical slices is that I think there's a reduced risk of integration problems so if you were thinking about a feature that needed to be delivered and you had to split that up across three different teams to go build independently within the layers that they're responsible for what ends up happening is if you don't have really clear cut sort of API contracts between the different layers and it's not well thought out all these teams go build their part independently and then when they come together and say hey look I'm done my part I'm done my part I'm done my part and you put it all together is it gonna work well perhaps perhaps not I would say more often than not probably doesn't work exactly as expected and that's because the amount of time and effort that has to go into upfront planning it helps but you're always going to encounter things along the way that needed adjustment and if you're not perfectly on top of communicating all of these things it's definitely at risk for some integration challenges so I'm not trying to say that it's impossible to split features up across teams that focus on layers but what I am saying is I do think it makes it more challenging and perhaps more risky when it comes time to integrate so that's our crash course on vertical slices and just to quickly summarize vertical slices are a software development approach that you're thinking about going vertically for your features and if you're thinking about that in contrast with a layered architecture layers in a layered architecture might be something like a database layer business logic presentation layer and again your vertical slice will cut through all of those players and actually allow you to deliver features end to end because they need each part of those layers when I'm done with the follow-up video I'll link it right over here and we'll actually look at implementing vertical slices and how that can look within your team so you can try that out thanks for watching and we'll see you next time foreign

Frequently Asked Questions

What are vertical slices in software development?

Vertical slices are a software development approach that focuses on delivering a feature from end to end, cutting through all layers of a layered architecture. This means that when I work on a feature, I consider all necessary components, such as the user interface, business logic, and data access, to ensure everything works together seamlessly.

How do vertical slices differ from traditional layered architecture?

In traditional layered architecture, we visualize different layers horizontally, focusing on technology or functional areas. In contrast, vertical slices span these layers vertically, allowing me to deliver complete functionality for a feature without getting bogged down in the individual layers.

What are the benefits of using a vertical slice approach?

Using a vertical slice approach can lead to faster feedback loops, improved collaboration among team members, and reduced risk of integration problems. By focusing on delivering features end to end, I can get feedback sooner, encourage teamwork across different skill sets, and minimize the challenges that come with integrating work done by separate teams.

These FAQs were generated by AI from the video transcript.
An error has occurred. This application may no longer respond until reloaded. Reload