<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Rafal Pienkowski</title>
    <description>The latest articles on Forem by Rafal Pienkowski (@rafalpienkowski).</description>
    <link>https://forem.com/rafalpienkowski</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F38515%2F7940efde-6e57-4e08-a3b4-054aa616e4bf.png</url>
      <title>Forem: Rafal Pienkowski</title>
      <link>https://forem.com/rafalpienkowski</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/rafalpienkowski"/>
    <language>en</language>
    <item>
      <title>My DDD journey</title>
      <dc:creator>Rafal Pienkowski</dc:creator>
      <pubDate>Mon, 13 Apr 2020 17:47:34 +0000</pubDate>
      <link>https://forem.com/rafalpienkowski/my-ddd-journey-57m8</link>
      <guid>https://forem.com/rafalpienkowski/my-ddd-journey-57m8</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;For some time, I have an interest in the Domain-Driven Desing. In my case, it didn't come from DDD's popularity nor something called CV-Driven development. Trust me or not, I want to write quality software, and I believe that DDD is the right (but the only one) technique to achieve that.&lt;/p&gt;

&lt;p&gt;From some time, I want to write something about this technique. I warn you that I don't consider myself as a DDD expert. There are a lot of smarter than me in this business. After all, I decided to describe how is my adventure with DDD looks like. As you can image the cover photo presents how the journey looked like. I want to show my subjective point of view. I want to share things which caused me problems, my failures and some wins. I could be pleasant if I could share your experience with me. It would be rapt if I inspire you or if you could take a lesson from my failures. In the end, Domain-Driven Design is a highly effective technique. In my opinion it worth to make an effort and get familiar with it.&lt;/p&gt;

&lt;p&gt;I think that it's not so hard to catch the main idea of DDD.  I like the definition of DDD which I have written by  &lt;a href="https://whatis.techtarget.com/definition/domain-driven-design" rel="noopener noreferrer"&gt;Margaret Rouse&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Domain-driven design (DDD) is a software development philosophy centered around the domain, or sphere of knowledge, of those that use it. The approach enables the development of software that is focused on the complex requirements of those that need it and doesn't waste effort on anything unneeded. The clients of domain-driven design are often enterprise-level businesses."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;As you can see, it doesn't seem to be a big deal. In my case, understanding the problem and practising were two different things.&lt;br&gt;
For a long time, I've felt as easy explaining to my colleagues why they should take advantage of DDD, how could it have a salutary effect of their code. As you can probably gather, that didn't equal that I fully understood the DDD itself. Of course, I knew basic concepts, building blocks but joining all dots together is a separate thing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Books are a solid starting point.
&lt;/h2&gt;

&lt;p&gt;I prefer to learn from books. Especially I like the fact that I can quickly come back to them when I face some problem. There are many publications about DDD. I obliged to start with the canon of literature: Eric Evans "blue book" &lt;a href="https://www.amazon.com/Domain-Driven-Design-Tackling-Complexity-Software/dp/0321125215" rel="noopener noreferrer"&gt;Domain-Driven Design: Tackling Complexity in the Heart of Software&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Frafalpienkowski%2Fresources%2Fmaster%2Fmy-ddd-journey%2Fevans_ddd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Frafalpienkowski%2Fresources%2Fmaster%2Fmy-ddd-journey%2Fevans_ddd.png" alt="Domain-Driven Design: Tackling Complexity in the Heart of Software"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That work was groundbreaking. By this position, Eric Evans spread the idea of Domain-Driven Desing. I like the way how building blocks are described there. After the lecture, you should have a solid foundation about them. In my opinion, the examples used to present the application of DDD are quite complicated. Neither printed circuit board nor shipping is not a piece of cake. A reader has to keep in mind that the book's first edition was in 2003. Although the idea didn't change since that time, in later years, new techniques like Event Sourcing came into play. The last thing, which even Evans admitted to, is the composition of chapters. The book starts with tactical DDD, and that leads to a situation where readers don't pay enough attention to the strategic part of DDD. In the end, we have a state when you know building block, but even if you use them in your work, they don't bring any value to the whole solution. Please don't be such a reader. Fortunately, the next position is free of this drawback.&lt;/p&gt;

&lt;p&gt;Vaughn Vernon's "red book" &lt;a href="https://www.amazon.com/Implementing-Domain-Driven-Design-Vaughn-Vernon/dp/0321834577" rel="noopener noreferrer"&gt;Implementing Domain-Driven Design&lt;/a&gt; is, in my opinion, the book that should be your first lecture. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Frafalpienkowski%2Fresources%2Fmaster%2Fmy-ddd-journey%2Fvernon_ddd.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Frafalpienkowski%2Fresources%2Fmaster%2Fmy-ddd-journey%2Fvernon_ddd.jpg" alt="Implementing Domain-Driven Design"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's more up to date (released in 2013). The agile project domain is approachable.  I think it's more natural to developers and requires less effort to understand.  Vaughn focuses more on strategic design. The book shows how vital strategic DDD is. Bounded contexts and integrations between them widely described. There is an excellent chapter dedicated to Domain Events. At the end of the title, in the appendix, we can find a section devoted to Event Sourcing. I think Implementing Domain-Driven Design, should be at the top of your reading list if you plan to start dive into DDD.&lt;/p&gt;

&lt;p&gt;Vaughn Vernon also wrote the &lt;a href="https://www.amazon.com/Domain-Driven-Design-Distilled-Vaughn-Vernon/dp/0134434420" rel="noopener noreferrer"&gt;Domain Driven Design Distilled&lt;/a&gt;. This short title (about 170 pages) purpose was to show the basics of DDD. In my opinion, don't waste your time and money on it. &lt;/p&gt;

&lt;p&gt;Last time I read an excellent book by Alexey Zimarev &lt;a href="https://www.amazon.com/Hands-Domain-Driven-Design-NET/dp/1788834097" rel="noopener noreferrer"&gt;Hands-On Domain-Driven Design with .NET Core: Tackling complexity in the heart of software by putting DDD principles into practice&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Frafalpienkowski%2Fresources%2Fmaster%2Fmy-ddd-journey%2Fzimarev_ddd.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Frafalpienkowski%2Fresources%2Fmaster%2Fmy-ddd-journey%2Fzimarev_ddd.jpeg" alt="Hands-On Domain-Driven Design"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This title contains code examples written in C#. I like the way Alexey introduce how to combine DDD with Event Sourcing. I think that is quite a hot topic. First of all, almost every system we try to implement is based on events. Besides that, ES solves the issue related to storing the aggregate roots and entities. It is not a simple task. If you want to save an object into a database, you have to expose its data. That requires the usage of getters, which is in contradiction to the exposing behaviour and hiding structure principle. But there's no such thing as a free lunch. ES requires you to change your mind. You store a sequence of events which allow you to recreate the object, but unlike way you may use to there is the current state of an object serialized in a table. You can take advantage of ES, but please keep in mind that this is connected with higher entry threshold for your colleagues.&lt;br&gt;
BTW "Hands-On Domain-Driven Design with .NET Core" has a dedicated &lt;a href="https://github.com/PacktPublishing/Hands-On-Domain-Driven-Design-with-.NET-Core" rel="noopener noreferrer"&gt;GitHub repository&lt;/a&gt;. Although all samples are in C#, I would recommend this position to everyone.&lt;/p&gt;

&lt;p&gt;In the next course I am going to read:&lt;br&gt;
&lt;a href="https://www.amazon.com/Patterns-Principles-Practices-Domain-Driven-Design/dp/1118714709" rel="noopener noreferrer"&gt;Patterns, Principles, and Practices of Domain-Driven Design&lt;br&gt;
&lt;/a&gt; and &lt;a href="https://leanpub.com/ddd_first_15_years" rel="noopener noreferrer"&gt;Domain-Driven Design: The First 15 Years&lt;/a&gt;. After the lecture, I will be able to tell you something about them.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Frafalpienkowski%2Fresources%2Fmaster%2Fmy-ddd-journey%2Fto_read.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Frafalpienkowski%2Fresources%2Fmaster%2Fmy-ddd-journey%2Fto_read.jpg" alt="To read"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To sum up, both books give strong basics. Don't kid yourself that after the lecture of them, you become a DDD ninja. You won't. I advise rereading those books after some time once again. If you have some practical knowledge, they will gain even more value for you.&lt;/p&gt;

&lt;h3&gt;
  
  
  Not only books
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Frafalpienkowski%2Fresources%2Fmaster%2Fmy-ddd-journey%2Fundraw_social_friends_175.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Frafalpienkowski%2Fresources%2Fmaster%2Fmy-ddd-journey%2Fundraw_social_friends_175.png" alt="Online"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Of course, there are other ways of learning, like audiobooks or video recordings from conferences. I don't like audiobooks, but I watched a few of them. In my opinion, that is a good starting point if you consider if DDD is for you. You invest a few hours and gain a quite extensive point of view.&lt;/p&gt;

&lt;p&gt;Another alternative is e-learning. For example, there is a whole DDD path on the &lt;a href="https://www.pluralsight.com/paths/domain-driven-design" rel="noopener noreferrer"&gt;Pluralsigh&lt;/a&gt;. I prefer to learn from books. I didn't take part in any of online course about DDD, so I'm not in a position to tell you anything significant about it. If you have some experience with that form of education, or could you share a helpful online course, please write about it in a comment. &lt;/p&gt;

&lt;h2&gt;
  
  
  Simple domain
&lt;/h2&gt;

&lt;p&gt;After we've gained the solid theory background, it's the time to get to know our domain. Here is the story which stands behind our system.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Frafalpienkowski%2Fresources%2Fmaster%2Fmy-ddd-journey%2Fundraw_reading_list_175.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Frafalpienkowski%2Fresources%2Fmaster%2Fmy-ddd-journey%2Fundraw_reading_list_175.png" alt="Story"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Our company is responsible for supplying the configuration to the clients. First, an operator creates a draft. A draft could go live immediately. It could be scheduled to become go live in the future.  That configuration we called planned. Live could be archived. An archive is the final step of each configuration's live cycle.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"Our system should be aware of the author and date when each configuration's stage was reached. Their first names, with the maximum length of 50 characters, enable to identify the authors. Our system allows storing configuration data limited to 250 characters. Our clients don't care about the date's precision. Information about hours, minutes and seconds is useless for them."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I'm aware that the presented story is a distilled version of a real-life scenario. I bet it wouldn't look like when you start working with your business. It usually takes days or weeks to produce a similar description. We don't have that much time.&lt;/p&gt;

&lt;p&gt;To make this easier below is an image which shows the live cycle of configuration made with &lt;a href="https://miro.com/" rel="noopener noreferrer"&gt;Miro&lt;/a&gt;. In my opinion, Miro is a great tool. It's suitable for the documentation. It also enables life cooperation on documents. Miro is a recommendable platform.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Frafalpienkowski%2Fresources%2Fmaster%2Fmy-ddd-journey%2Fworkflow_small.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Frafalpienkowski%2Fresources%2Fmaster%2Fmy-ddd-journey%2Fworkflow_small.jpg" alt="Workflow"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The shared understanding
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Frafalpienkowski%2Fresources%2Fmaster%2Fmy-ddd-journey%2Fundraw_conversation_175.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Frafalpienkowski%2Fresources%2Fmaster%2Fmy-ddd-journey%2Fundraw_conversation_175.png" alt="Converstation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First of all, we need to build a shared understanding of our business. Without proper comprehension, we won't be able to write good software. There is no better way to learn how to business works than by talking to business people. Quite obvious, don't you think. Based on my experience talking is way, way better form of communication than the written form like documentation, diagrams etc. I don't say that documents and charts are wrong. They are handy to build understanding. &lt;/p&gt;

&lt;p&gt;We should focus on the language we use. It shortens the distance between domain experts and developers is the foundation of DDD. The best way to achieve this is to talk to each other in the same language. Eric Evans called it  &lt;a href="https://martinfowler.com/bliki/UbiquitousLanguage.html" rel="noopener noreferrer"&gt;"Ubiquitous language"&lt;/a&gt;. Using the same language avoids misunderstanding. Reflecting business terms in code makes it simpler to maintain. We can forget about translating from a "technical jargon" to a "business terms". Forget about enums, flags, statuses etc. Name those objects like business people are doing on every day. &lt;/p&gt;

&lt;p&gt;What I've forgotten is that langue is &lt;strong&gt;ubiquitous&lt;/strong&gt;. It means that not only a business person is allowed to add words to it. It's perfectly fine if a developer proposes a new term. Still, business is the most important, but we as technical people could also help and add throw in one's two cents.&lt;/p&gt;

&lt;h3&gt;
  
  
  Event Storming
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Frafalpienkowski%2Fresources%2Fmaster%2Fmy-ddd-journey%2Fevent_storming_small.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Frafalpienkowski%2Fresources%2Fmaster%2Fmy-ddd-journey%2Fevent_storming_small.jpeg" alt="Event Storming"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Extracting the domain experts language is challenging. There are many technics which make this process more peaceful. Recently the most popular is &lt;a href="https://www.eventstorming.com/" rel="noopener noreferrer"&gt;Event Storming&lt;/a&gt; invented by Alberto Brandolini. You could read Alberto's unfinished book. Don't worry, Alberto follow the &lt;a href="https://en.wikipedia.org/wiki/Pareto_principle" rel="noopener noreferrer"&gt;Pareto Principle&lt;/a&gt;, and the current content of his book is enough to get the idea and perform a workshop. Of course, facilitating such a workshop requires skills and knowledge, but Rome wasn't built in a day. Also, Mariusz Gil has an excellent &lt;a href="https://github.com/mariuszgil/awesome-eventstorming" rel="noopener noreferrer"&gt;repository&lt;/a&gt; dedicated to the topic. This repo is an Event Storming in a nutshell with many materials and links to external articles. &lt;/p&gt;

&lt;p&gt;I read Alberto's book and took part in a 3-day workshop only about Event Storming technique. I conducted some event storming sessions. My experience is that the most interested in facilitating are developers. It was taff to convince business people to take part in it.  I talked with many developers, and they said that it's a common issue that business doesn't trust us. "Busines," thinks that this is another fancy developer's pet toy, which doesn't bring any value to them. &lt;/p&gt;

&lt;h2&gt;
  
  
  Focus on strategy, a tactic will come by itself
&lt;/h2&gt;

&lt;p&gt;Sun Tzu great Chinese general and author of the book: "The Art of War" said:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Frafalpienkowski%2Fresources%2Fmaster%2Fmy-ddd-journey%2Fsun_tzu_small.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Frafalpienkowski%2Fresources%2Fmaster%2Fmy-ddd-journey%2Fsun_tzu_small.jpg" alt="Sun Tzu"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I bring up this saying to highlight how vital strategic DDD is. We are familiar with our business domain. However, it's description is a little bit shallow. I did it intentionally because I saw similar stories many times, and I think that they omit the most crucial information. In my opinion, we necessarily need to find out functional and non-functional requirements. Such insights are essential to build full understanding and consciously decide about the architecture of our system. &lt;/p&gt;

&lt;p&gt;For instance, we could assume that the live configurations should have such features like high availability and low latency. We don't have to care about writes, but reads are crucial. Let's face it, code which is written concerning the DDD rules could not be the best solution. DDD is best when we talk about write operations. DDD ends with a system which is easy to maintain and extend.&lt;br&gt;
On the other hand, it is not optimized for fast reads. Instead of instantiating repository, which loads our the aggregate root, it would be more efficient just to perform a simple SQL query. Maybe the classic relational database wouldn't meet the performance expectations, and you would have to take advantage of Redis with a denormalized data model. BTW, did you think about &lt;a href="https://martinfowler.com/bliki/CQRS.html" rel="noopener noreferrer"&gt;Command Query Responsibility Segregation CQRS&lt;/a&gt;? If your answer is yes, that's good for you. Commands work perfectly with DDD. I'm not going into details about CQRS. Of course, feel free to explore it on our own.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Frafalpienkowski%2Fresources%2Fmaster%2Fmy-ddd-journey%2Fundraw_creative_thinking_175.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Frafalpienkowski%2Fresources%2Fmaster%2Fmy-ddd-journey%2Fundraw_creative_thinking_175.png" alt="Creative thinking"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's take a closer look at the second example. The business comes to us with a new feature request. The system has to support media attachments like images and media files. That doesn't mean that we should store blob in our domain model. Depending on the business needs, there could exist an invariant saying that regular customers are allowed to add three images, while enterprise customers are can add up to five files. We could add an attachment's identifier to our entity. The module responsible for storing and serving files is a different context. Probably we wouldn't need DDD there. A simple CRUD application will be good enough. &lt;/p&gt;

&lt;p&gt;That brings me to a quite common misconception that DDD everywhere. I made that mistake a couple of times. I learnt about DDD, and I saw aggregate roots, entities and value objects everywhere. I'm not saying that code written concerning DDD is slower. No. It doesn't mean any such thing, but undeniably to write this code you need more of your time. That is a big waste. Instead of writing the code which probably will never be changed, you could focus on the crucial part of your's company areas—the areas which bring money to your company and also to you. I've heard that DDD relates to maximum ten-fifteen percent of the whole system.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Frafalpienkowski%2Fresources%2Fmaster%2Fmy-ddd-journey%2Fundraw_synchronize_175.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Frafalpienkowski%2Fresources%2Fmaster%2Fmy-ddd-journey%2Fundraw_synchronize_175.png" alt="Iterative"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Last but not least, modelling an aggregate isn't a straightforward task. There is nothing to cheat that you will model the domain in the final shape on the first try. Domain modelling is an iterative process. My advice is not only to focus on the model's sketch on the whiteboard. Recalling the onion architecture domain model is placed in the middle without any dependencies. This implicates that writing some sample code, for instance, some unit tests, is an easy task. We could quickly validate our model and make corrections to it. In my opinion, nighter UI nor an API is required for that. That causes that any changes concern only on a small independent piece of code.&lt;/p&gt;

&lt;p&gt;I think that I stop for now. Firstly I want that strategic DDD stick in your mind. Please think about it and don't make my failures. Secondly, it isn't my intention to bore you to death. I plan to focus more on the code itself in the next part of my story. I hope you will be with me.&lt;/p&gt;

&lt;p&gt;I will be delighted if you share a story about your DDD journey. &lt;/p&gt;

&lt;p&gt;Pictures come from &lt;a href="https://undraw.co/" rel="noopener noreferrer"&gt;Undraw&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ddd</category>
      <category>programming</category>
      <category>architecture</category>
      <category>learning</category>
    </item>
    <item>
      <title>Easy to create .gitignore for the dotnet developers</title>
      <dc:creator>Rafal Pienkowski</dc:creator>
      <pubDate>Sun, 01 Dec 2019 19:41:35 +0000</pubDate>
      <link>https://forem.com/rafalpienkowski/easy-to-create-gitignore-for-the-dotnet-developers-1h42</link>
      <guid>https://forem.com/rafalpienkowski/easy-to-create-gitignore-for-the-dotnet-developers-1h42</guid>
      <description>&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt; Starting from .Net Core 3.0, you can take advantage of the build in the .Net framework gitignore file template just by typing &lt;code&gt;dotnet new gitignore&lt;/code&gt; in your terminal.&lt;/p&gt;




&lt;p&gt;I assume you are familiar with the idea of a gitignore file. In short words, a .gitignore file is a plain text file in which each line contains a pattern for files or directories to be ignored by the git.&lt;/p&gt;

&lt;p&gt;I am a dotnet developer. I don't know if you had this problem, but every time I wanted to create a new repository on the git repository, I lacked the build-in .gitignore file. &lt;a href="https://dev.to/kritner"&gt;Russ Hammett&lt;/a&gt; made me realize that the GitHub platform has prepared a gititnore file. Interestingly it isn't named C#, CSharp, dotnet. Nope, none of those things. It's called VisualStudio. Quite obvious.Once again thanks Russ.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0e4h3yuz3ncgxq4ighyf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0e4h3yuz3ncgxq4ighyf.png" alt="Repo creation" width="512" height="629"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I like to have a tidy repository without &lt;code&gt;/obj/*&lt;/code&gt; and &lt;code&gt;/bin/*&lt;/code&gt; objects, or other IDE specific things included. Storing such files is both messy and could be dangerous. For instance, you could forget to clean from those artifacts your super-secret password.&lt;/p&gt;

&lt;p&gt;One of the possible solutions was to copy a .gitignore file from one repository to another. Not a very elegant but effective solution. Another option is to use sites like &lt;a href="https://www.gitignore.io/" rel="noopener noreferrer"&gt;https://www.gitignore.io/&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Today that has changed. The .Net Core 3.0 SDK gives us a hand.  I bet you now dotnet new command. It has a lot of parameters like &lt;em&gt;mvc&lt;/em&gt;, &lt;em&gt;webapp&lt;/em&gt;, or &lt;em&gt;webapi&lt;/em&gt;. Starting from SDK 3.0, there is a new parameter &lt;strong&gt;gitignore&lt;/strong&gt;, which creates a dotnet gitignore file.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

dotnet new gitignore


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The created file is a good starting point. It contains rules for the most popular IDEs like Visual Studio, Rider, Visual Studio Code, and tools like NCrunch, R#, Visual Studio profiler, or StyleCop. Of course, you can add your own rules to it.&lt;/p&gt;

&lt;p&gt;There is still missing documentation on the &lt;a href="https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-new" rel="noopener noreferrer"&gt;docs Microsoft site&lt;/a&gt;, but you can check it on yourself by typing in your command prompt:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

dotnet new


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;and going through the documentation which is attached there. Here is &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkhbkzqpylysuapumu4to.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkhbkzqpylysuapumu4to.png" alt="terminal output" width="800" height="776"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I think that the online documentation will be completed soon. Meanwhile, you can take advantage of the build-in gitignore feature, and you don't have to copy the file from other repositories.&lt;/p&gt;

&lt;p&gt;P.S. Don't forget about other dotnet cli commands and options.&lt;/p&gt;

&lt;p&gt;Cheers!&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>dotnet</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Don't starve your Cookie Monster</title>
      <dc:creator>Rafal Pienkowski</dc:creator>
      <pubDate>Mon, 25 Mar 2019 20:52:51 +0000</pubDate>
      <link>https://forem.com/rafalpienkowski/dont-starve-your-cookie-monster-1e3g</link>
      <guid>https://forem.com/rafalpienkowski/dont-starve-your-cookie-monster-1e3g</guid>
      <description>&lt;p&gt;First of all I want to say a few words about the cover image. I bet almost all of you know a &lt;a href="https://en.wikipedia.org/wiki/The_Muppets"&gt;Muppet&lt;/a&gt; called &lt;a href="https://en.wikipedia.org/wiki/Cookie_Monster"&gt;Cookie Monster&lt;/a&gt;. As well as Cookie Monster doesn't like when there are no cookies, our threads don't like to be blocked.&lt;/p&gt;

&lt;p&gt;Work with threads isn't simple. That is quite obvious for everyone who tried it. One of a vast number of issues is an exclusive lock of a given resource which provides us thread synchronization.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/69FpUKMjZ1er2lc5AZ/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/69FpUKMjZ1er2lc5AZ/giphy.gif" alt="synchronize"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The easiest way to synchronize the access to a resource is to use the &lt;a href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/lock-statement"&gt;&lt;em&gt;lock&lt;/em&gt;&lt;/a&gt; statement on a guard variable. Just like the example below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var guard = new object();
lock(guard)
{
    // access the critical path
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you think that harmless &lt;em&gt;lock&lt;/em&gt; couldn't be dangerous, you are wrong. This simple and it might seem an easy way to the threads synchronization may end with &lt;a href="https://en.wikipedia.org/wiki/Deadlock"&gt;&lt;strong&gt;a DEADLOCK&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/3o7TKqnMdPFGtzD6zm/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/3o7TKqnMdPFGtzD6zm/giphy.gif" alt="deadlock"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You may ask how this is possible. To understand the problem, we need to dive deeper and understand how the compiler process the code given above.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var guard = new object();
try
{
    Monitor.Enter(guard);
    // access the critical path
}
finally
{
    Monitor.Exit(guard);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The lock statement has been replaced with the &lt;a href="https://docs.microsoft.com/en-us/dotnet/api/system.threading.monitor.enter?view=netframework-4.7.2"&gt;&lt;em&gt;Monitor.Enter()&lt;/em&gt;&lt;/a&gt; method. How does this method work? A thread requests the lock on a resource and waits until the access will be obtained. How this can produce a deadlock. Let's take a look at this example of two threads synchronization on two guard variables.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Thread A locks guard X&lt;/li&gt;
&lt;li&gt;Thread B locks guard Y&lt;/li&gt;
&lt;li&gt;Thread A wants to lock guard Y, but guard Y is locked by thread B&lt;/li&gt;
&lt;li&gt;Thread B wants to lock guard X, but thread A locks guard X&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Our threads A and B are waiting and waiting until the end of the world just as Cookie Monster is sadly waiting for cookies.&lt;br&gt;
&lt;a href="https://i.giphy.com/media/o5oLImoQgGsKY/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/o5oLImoQgGsKY/giphy.gif" alt="waiting"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can prevent this situation by merely using another method from &lt;a href="https://docs.microsoft.com/en-us/dotnet/api/system.threading.monitor?view=netframework-4.7.2"&gt;*the Monitor *&lt;/a&gt; class. The method is named &lt;a href="https://docs.microsoft.com/en-us/dotnet/api/system.threading.monitor.tryenter?view=netframework-4.7.2"&gt;&lt;em&gt;TryEnter&lt;/em&gt;&lt;/a&gt;. Why it's so special? It could take as an argument the specified amount of time indicating how long the attempts will be repeated. After the given time thread will proceed further — no more deadlocks.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var guard = new object();
try
{
    Monitor.TryEnter(guard, TimeSpan.FromSeconds(15));
    // access the critical path
}
finally
{
    Monitor.Exit(guard);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A good practice is to ensure that the lock is released by calling the &lt;a href="https://docs.microsoft.com/en-us/dotnet/api/system.threading.monitor.exit?view=netframework-4.7.2"&gt;&lt;em&gt;Monitor.Exit&lt;/em&gt;&lt;/a&gt; method on given guard.&lt;/p&gt;

&lt;p&gt;I know that the lock statement is shorter than using explicit Monitor.TryEnter method, but the effort devoted to writing some extra lines of code could turn to you on a Sunday evening during the production deploy.&lt;/p&gt;

&lt;p&gt;To sum up.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Avoid using the lock statement and start using &lt;strong&gt;&lt;em&gt;Monitor.TryEnter&lt;/em&gt;&lt;/strong&gt;. Your threads will be grateful.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/lD76yTC5zxZPG/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/lD76yTC5zxZPG/giphy.gif" alt="Thanks"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All the gifs came from &lt;a href="https://giphy.com/"&gt;giphy.com&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>dotnet</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Doubles can be dangerous</title>
      <dc:creator>Rafal Pienkowski</dc:creator>
      <pubDate>Mon, 11 Mar 2019 20:24:52 +0000</pubDate>
      <link>https://forem.com/rafalpienkowski/doubles-can-be-dangerous-41f</link>
      <guid>https://forem.com/rafalpienkowski/doubles-can-be-dangerous-41f</guid>
      <description>&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;In my career, I've heard many times: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Always use the proper data type."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;or according to mine.Net experience: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Never use double to math calculations."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Sounds familiar to you? Do you think it is silly? Do you think you don't care about it? I assume that you've heard similar statements and please don't think that it's only claptrap. If you don't agree with me or you want to know why using doubles is so dangerous this post is made for you.&lt;/p&gt;

&lt;h3&gt;
  
  
  Simple experiment
&lt;/h3&gt;

&lt;p&gt;Let's start with a simple experiment. Of course, you can do it on your own. Take a look at the following code:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Do you guess how the result will be? Let check this out:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rafpie@Oxygen ~/Desktop/double dotnet run
Math is broken. 0.1 + 0.2 isn't 0.3. That's odd!?!?

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Our experiment proofs that math is broken. What!?! That isn't possible. We were taught that 0.1 + 0.2 = 0.3. What the hell is going on here? &lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/1r6KkcEU0qyu4/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/1r6KkcEU0qyu4/giphy.gif" alt="what the hell"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The crucial point is how our computer represents doubles. I assume that you're familiar with the number's binary representation if not &lt;a href="https://www.bottomupcs.com/chapter01.xhtml" rel="noopener noreferrer"&gt;here is an article&lt;/a&gt; about that. TThe representation of 0.1 in the binary model is as follows:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Frafalpienkowski%2Fresources%2Fmaster%2Fdouble-can-be-dangerous%2Fbinary_representation.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Frafalpienkowski%2Fresources%2Fmaster%2Fdouble-can-be-dangerous%2Fbinary_representation.png" alt="0.1 in binary representation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Mostly we focus on the integer part (the left side of the chart), but for now, the right side is more important. To receive 0.1 we have to sum the corresponding powers of two:&lt;/p&gt;

&lt;p&gt;1/2^4 + 1/2^5 + 1/2^8 + 1/2^9 + 1/2^12 + 1/2^13+....&lt;/p&gt;

&lt;p&gt;Let's sum first six elements:&lt;/p&gt;

&lt;p&gt;1/16 + 1/32 + 1/256 + 1/512 + 1/4096 + 1/8192 =0,099975586&lt;/p&gt;

&lt;p&gt;As you can see, we received an approximated result. That leads us to the simple conclusion:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Never compare double values with the == operator!&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In the best-case scenario, you will miscalculate the high of your quarterly bonus, in the worst-case scenario someone can die. I'm deadpan here. On February 25, 1991 (the Gulf War) an American Patriot missile battery used double values in the calculation. Due to inaccuracy, 28 soldiers lost their lives. &lt;a href="http://www-users.math.umn.edu/~arnold/disasters/patriot.html" rel="noopener noreferrer"&gt;More info you can find here&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  The solution
&lt;/h3&gt;

&lt;p&gt;You can ask how we can overcome this problem. The answer is to use decimal values. The value with the decimal type is stored as a large integer with the decimal point shifted. That means, 0.1 is stored as 1, 0.123 is stored as 123. If you don't trust me, modify our previous example and change datatype from double to decimal (Notice, you have to add M after the number to indicate the literal decimal value). &lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;The result will be compatible with the expected one:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rafpie@Oxygen ~/Desktop/decimal dotnet run
0.1 + 0.2 is 0.3

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Uff, math works.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/jIv6pfqKiIvHPYZO6y/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/jIv6pfqKiIvHPYZO6y/giphy.gif" alt="Math works"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Summary
&lt;/h3&gt;

&lt;p&gt;I hope that I explained to you why we should be careful with double values. As you can see this could have significant impact correctness of the program's calculations.&lt;br&gt;
I premise on double type built-in the .Net Framework. If someone knows how this problem is addressed in other programming languages, please share that with us.&lt;/p&gt;

&lt;p&gt;Note: Background images cames from &lt;a href="https://pixabay.com/photos/nuclear-weapons-test-nuclear-weapon-67557/" rel="noopener noreferrer"&gt;the pixabay&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>programming</category>
      <category>beginners</category>
      <category>csharp</category>
    </item>
    <item>
      <title>Turn VM off and give my money back</title>
      <dc:creator>Rafal Pienkowski</dc:creator>
      <pubDate>Mon, 25 Feb 2019 11:18:49 +0000</pubDate>
      <link>https://forem.com/rafalpienkowski/turn-vm-off-and-give-my-money-back-3ekb</link>
      <guid>https://forem.com/rafalpienkowski/turn-vm-off-and-give-my-money-back-3ekb</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;In the previous episode, I get familiar with payment methods and cloud model which are available in Azure. Now I'm going to take a closer look to cost optimization of Virtual Machines (VM), which are in my opinion, the base of IaaS.&lt;/p&gt;

&lt;h3&gt;
  
  
  Virtual Machine
&lt;/h3&gt;

&lt;p&gt;First of all, you need to know that a "typical" Virtual Machine in the Azure consists of several components:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;storage account - is used for backups/snapshots and the disk for the VM&lt;/li&gt;
&lt;li&gt;disk - optional disk which could be attached to the VM&lt;/li&gt;
&lt;li&gt;virtual machine &lt;/li&gt;
&lt;li&gt;network interface - enables the VM to communicate with virtual network&lt;/li&gt;
&lt;li&gt;network security group - is used to allow or deny network traffic to the VM&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1v5rS1R8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/rafalpienkowski/resources/master/azure-cost-opt/vm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1v5rS1R8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/rafalpienkowski/resources/master/azure-cost-opt/vm.png" alt="VM"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You must keep in mind that "typical" VM is, in fact, a combination of several elements. Why it's so important? Only in the case of VM itself, the fees are calculated for every second it's being used. When the VM is down no charges are applied. So what that gives to us? The answer is simple. Shut down your VM when you don't need it. For instance, if we have a VM dedicated for the dev team. It could be taken down during off hours. I don't mean to go to the Azure portal once or twice a day and doing it manually. Oh no, this isn't my intention. We should automatize our job as far as it's possible. &lt;a href="https://azure.microsoft.com/en-us/services/automation/"&gt;Azure Automation&lt;/a&gt; comes with help. You don't have to have expert knowledge to do that. You can do it by clicking in the Azure Portal. The article: &lt;a href="https://azure.microsoft.com/en-us/services/automation/"&gt;Start/Stop VMs during off-hours solution in Azure Automation&lt;/a&gt; is an excellent starting point.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MzG4yi38--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/rafalpienkowski/resources/master/azure-cost-opt/azure-scheduler.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MzG4yi38--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/rafalpienkowski/resources/master/azure-cost-opt/azure-scheduler.jpg" alt="Azure Scheduler"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The scheduler available in the Azure portal isn't perfect. Available schedule options are one time, monthly, weekly, daily, hourly. It isn't enough to shut down our VM during the weekends or national holidays. Fortunately, we can write our own runbooks and customize the scheduler's behavior. &lt;a href="https://blog.kloud.com.au/2016/03/16/add-workdays-and-public-holidays-to-your-azure-automation-runbooks/"&gt;Here&lt;/a&gt; is an example. The nice thing is that we can automate the schedule creation as well. To do that we need to use Azure Resource Manager (ARM) template. ARM is a topic for a separate post, so, for now, I'll only give a link to the &lt;a href="https://docs.microsoft.com/en-us/azure/automation/automation-deploy-template-runbook"&gt;Deploy an Azure Resource Manager template in an Azure Automation PowerShell runbook&lt;/a&gt; article for interested. &lt;/p&gt;

&lt;p&gt;So let's calculate possible saving resulting from switching of the VM. For the calculation, I took DS3 V2 VM (O/S Windows), and I assumed that the VM would be running every working day for 13 hours. In an average month has 23 working days, so we have 299 hours. The table below compares the cost of the VM working 24/7 with the VM running only during work hours. In short, we can save more than 200$ monthly. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZWH2FaXh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/rafalpienkowski/resources/master/azure-cost-opt/vm_pricing.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZWH2FaXh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/rafalpienkowski/resources/master/azure-cost-opt/vm_pricing.png" alt="VM pricing"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But what in case, when our VM have to work 24/7? After all, this is not an unusual case. In that scenario, &lt;a href="https://azure.microsoft.com/en-us/pricing/reserved-vm-instances/"&gt;Azure Reserved VM Instances (RIs)&lt;/a&gt; comes into play. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--E54ewLYx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/rafalpienkowski/resources/master/azure-cost-opt/reserved.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--E54ewLYx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/rafalpienkowski/resources/master/azure-cost-opt/reserved.jpg" alt="Reserved"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;How RI works? We are requesting VM for a specific time (one or three years) and paying in advance for it. In the case of DS3 v2 (Windows), VM mentioned earlier, reserving it for one year gives us ~35% savings (~45% when reserved for three years). The exciting part is that taking VM with Linux O/S gives us more benefits (~40% and ~59% respectively).  &lt;/p&gt;

&lt;p&gt;Other benefits of RI:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;VM which is bought in RI doesn't have to work 24/7&lt;/li&gt;
&lt;li&gt;we can exchange VM types within RI&lt;/li&gt;
&lt;li&gt;VM ordered as Reserved Instance may work longer that RI duration&lt;/li&gt;
&lt;li&gt;we can anytime cancel RI order, but we have to keep in mind that Microsoft will charge a fee of 12% of unused funds&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For those, who already have a license with the Software Assurance for MS Windows Server or MS SQL Server, &lt;a href="https://azure.microsoft.com/en-us/pricing/hybrid-benefit/"&gt;Azure Hybrid benefit&lt;/a&gt; could be an exciting option. It's based on the &lt;em&gt;bring your own license (BYOL)&lt;/em&gt; model. In short, you already have a license which you could use on your on-prem environment. This license could be used in the Azure cloud environment and thereby we don't have to pay twice for the same. The azure Hybrid benefit can save up to 40% of VM's costs. &lt;/p&gt;

&lt;h3&gt;
  
  
  Summary
&lt;/h3&gt;

&lt;p&gt;That will be all for now. In the next episode, I'm going to focus on components of the Platform as a Service model (App Service and Azure SQL Database). &lt;/p&gt;

&lt;p&gt;See you in the next episode.&lt;/p&gt;

&lt;p&gt;P.S. All photos used in this post came from &lt;a href="https://unsplash.com/"&gt;unsplash.com&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>cloud</category>
      <category>azure</category>
      <category>devops</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Azure cost optimization</title>
      <dc:creator>Rafal Pienkowski</dc:creator>
      <pubDate>Wed, 20 Feb 2019 15:38:04 +0000</pubDate>
      <link>https://forem.com/rafalpienkowski/azure-cost-optimization-5acc</link>
      <guid>https://forem.com/rafalpienkowski/azure-cost-optimization-5acc</guid>
      <description>&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;I want to introduce by this post a whole series of blog posts covering some tips for the cost optimization which we can apply in the Azure Cloud. &lt;/p&gt;

&lt;p&gt;It's possible that you have already implemented all of my suggestions. In that case, good for you! Otherwise, you're still able to become a hero in your company, save some money which you have to pay for Azure's invoices, and spend it for some nice stuff like a new board game in your office or a corporate retreat. Or maybe you've heard that MS Azure solutions can make your software more reliable or code deployment into the Azure's App Service with conjunction with Azure DevOps is much simpler than your current CI/CD process, but after raw cost calculation, your boss declined your suggestion to use Azure because the cost of the cloud is too high? Hmm? Sounds familiar to you? If so, I invite you to read further. Those tips aren't secret knowledge and are easy to implement.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---jYj3eh3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/rafalpienkowski/resources/master/azure-cost-opt/hero.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---jYj3eh3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/rafalpienkowski/resources/master/azure-cost-opt/hero.png" alt="Hero"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After this lengthy introduction, it is high time for specific advice. &lt;br&gt;
First of all, we need to answer two simple questions. Are you ready? Let's go with the first question.&lt;/p&gt;

&lt;h3&gt;
  
  
  What licensing model do you have?
&lt;/h3&gt;

&lt;p&gt;Depending on the model you've chosen, you can decrease the monthly cost of Azure. A short recap of available models and their brief description.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://azure.microsoft.com/en-us/offers/ms-azr-0003p/"&gt;Pay-As-You-Go&lt;/a&gt;&lt;br&gt;
Most popular one. It's easy to set up. What we only need is an available credit card which will be bounded with our subscription. Every 30 days you will receive an invoice for used resources and necessary funds will be withdrawn from your credit card.  You're paying only for used resources. The nice thing is that upgrading from Azure Free Account to PAYG is easy.  And that's all. In this billing method, we don't have much room to reduce the cost.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://azure.microsoft.com/en-us/offers/ms-azr-0111p/"&gt;Azure in Open (AIO)&lt;/a&gt;&lt;br&gt;
In this model, you're buying scratch cards from Microsoft partner. Each card is worth 100$. AIO is quite similar to the Pay-As-You-Go model. The difference is that you have to pay before we use the resource. We can save some money by buying scratch cards in bulk. Depending on your partner and the number of scratches you want to get you can negotiate the discount. In the AIO model, you have to activate the scratch in three years and use available resources in one year.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://partner.microsoft.com/en-us/cloud-solution-provider"&gt;Cloud Solution Provider (CSP)&lt;/a&gt;&lt;br&gt;
The CSP works like the Pay-As-You-Go model. The main difference is that you're paying directly to the MS partner instead of Microsoft. Worth to mention is that our support tickets are going to the partner instead of Microsoft support.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://azure.microsoft.com/en-us/pricing/purchase-options/enterprise-agreement/"&gt;Enterprise Agreement (EA)&lt;/a&gt;&lt;br&gt;
If your solution regularly consumes a significant amount of money (about 17 500 $/ year), you can try to go into the Enterprise Agreement model. In this model, you're buying access to the Azure from Microsoft's Partner. The EA is set up for a one or three year period. You're paying in advance for the given period (of course if you use bought resources before the end of the agreement, you can set up new agreement). Here you've got the greatest opportunities in discount negotiations. An interesting thing is you gain access to the new management portal (&lt;a href="https://ea.azure.com/"&gt;https://ea.azure.com/&lt;/a&gt;) instead of the &lt;em&gt;classic&lt;/em&gt; one (&lt;a href="https://portal.azure.com/"&gt;https://portal.azure.com/&lt;/a&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Did you find your licensing model? I hope so. Now it's the time for the second question.&lt;/p&gt;

&lt;h3&gt;
  
  
  What type of cloud environment are we using?
&lt;/h3&gt;

&lt;p&gt;This is a quite fundamental question. Why? Because depending on the environment, type pricing plan is constructed and going further an invoice is created.  Let me do a  short recap of available cloud models and how they're related with "traditional" on-premise environment.&lt;/p&gt;

&lt;p&gt;Main models:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Infrastructure as a Service (IaaS)&lt;br&gt;
I would say this is model could be treated as the first step into cloud computing. In short words, we're placing our Virtual Machine (VM) image into the cloud. We're responsible for i.a. O/S installation and maintenance required frameworks, runtime installation, and patching, etc. We have to care about many things, but we receive a low entry threshold. We can take our VM image and put it into the cloud. In the context of money saving, we should take a look at &lt;em&gt;Microsoft.Compute&lt;/em&gt; pricing plan (we're billed based on the time we use the resource). I'll describe in details in the next episode.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Platform as a Service (PaaS)&lt;br&gt;
In this case, we are partially giving away the responsibility for the preparation and maintenance of our environment. For instance, all things related to the O/S and runtime are no longer our problem. The end with applying patches to our O/S. Now that is our vendor's problem. According to the Service Level Agreement (SLA) vendor ensures the availability of the platform. But we need to keep in mind that in the PaaS model we're losing some influence on the infrastructure itself and we have to adjust our solution to a given platform. According to Azure documentation: "Platform as a service (PaaS) is a complete development and deployment environment in the cloud." An example of such a resource in MS Azure is App Service or Azure SQL Database. Mainly in the PaaS model, we are paying for the whole time when the service is created, even if we are not using it. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Function as a Service (FaaS)&lt;br&gt;
I'd say that this is a specific subset for PaaS. The responsibility for the Data and Application is moved to the vendor. For example, instead of writing a whole application to serve some HTTP request we can use Azure Functions. In that case, Microsoft takes care of the part responsible for calling our function when a request came to the server.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Software as a Service (SaaS)&lt;br&gt;
In the SaaS model, we're purchasing access to software. Excellent examples are Office 365 or Spotify. In short words, we're paying for the ability to use given a program for some time.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Below is the image comparing the mentioned models.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RbaY40F9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/rafalpienkowski/resources/master/azure-cost-opt/cloud-model.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RbaY40F9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/rafalpienkowski/resources/master/azure-cost-opt/cloud-model.png" alt="On-Prem vs IaaS vs PaaS vs SaaS"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With answers to the two main questions, we're ready for further steps. I hope you are not too bored. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JAhjbGPN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/rafalpienkowski/resources/master/azure-cost-opt/bored.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JAhjbGPN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/rafalpienkowski/resources/master/azure-cost-opt/bored.png" alt="Bored"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the next episode, I'll describe how we can save some money consuming cloud in the Infrastructure as a Service model. I'll tell you how to reduce cost working with the Virtual Machines hosted in the Azure.&lt;/p&gt;

&lt;p&gt;See you in the next episode!&lt;/p&gt;

&lt;p&gt;P.S. All photos used in this post came from &lt;a href="https://unsplash.com/"&gt;unsplash.com&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>cloud</category>
      <category>azure</category>
    </item>
    <item>
      <title>Microservices by example with DevMentors</title>
      <dc:creator>Rafal Pienkowski</dc:creator>
      <pubDate>Tue, 22 Jan 2019 11:04:43 +0000</pubDate>
      <link>https://forem.com/rafalpienkowski/microservices-by-example-with-devmentors-505m</link>
      <guid>https://forem.com/rafalpienkowski/microservices-by-example-with-devmentors-505m</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;I think that almost everyone has heard about the Microservice Architecture.   It isn't my intention to glorify or reprove this architecture's approach.  As any solution microservices have their good and bad sites. Let's get familiar with the Microservice architecture to make up our mind. So I came to the heart of the matter. I want to tell you about a project called "Distributed .Net Core - DShop" in brief DShop. It is a project driven by two enthusiasts of microservice's solutions and Microsoft technologies: &lt;a href="https://www.linkedin.com/in/dariusz-pawlukiewicz-7ba162a2/" rel="noopener noreferrer"&gt;Dariusz Pawlukiewicz&lt;/a&gt; and &lt;a href="https://www.linkedin.com/in/piotrgankiewicz/" rel="noopener noreferrer"&gt;Piotr Gankiewicz&lt;/a&gt;. They are the founders of &lt;a href="https://devmentors.io/" rel="noopener noreferrer"&gt;DevMentors&lt;/a&gt;. Why do I think it's worth to mention this particular project? There are a few reasons why people interested in microservices, CQRS, C#, and DDD should take a look at this project (even if you are not familiar with C#, but you know another C-family programming language ex. C++, Objective-C, Java, etc., you would find something interesting for you).  &lt;/p&gt;




&lt;p&gt;Five reasons why you should get interested in this project:&lt;/p&gt;

&lt;h3&gt;
  
  
  1) Microservice Architecture is a hot topic
&lt;/h3&gt;

&lt;p&gt;This is my subjective opinion, and I assume that yours too otherwise you wouldn't read my text. I think that microservices as an architectural pattern are interesting.  I'm not saying that they are a silver bullet and they can solve any problem, but in my opinion, it's good to know what benefits and what issues are bounded with the Microservice Architecture. The best way is to give it a try, and DShop is an excellent opportunity for that.&lt;/p&gt;

&lt;h3&gt;
  
  
  2) DShop is open sourced
&lt;/h3&gt;

&lt;p&gt;You can find all the microservices which are taking part in the solution in public &lt;a href="https://github.com/devmentors" rel="noopener noreferrer"&gt;Github repositories&lt;/a&gt;. Anyone can look over the source code and grab those parts which he or she considers attractive. Of course, the most efficient way of getting to know the project is to contribute. Feel free to make a pull request.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/devmentors" rel="noopener noreferrer"&gt;
        devmentors
      &lt;/a&gt; / &lt;a href="https://github.com/devmentors/DNC-DShop" rel="noopener noreferrer"&gt;
        DNC-DShop
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Distributed .NET Core&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/devmentors/DNC-DShop/blob/master/assets/devmentors_logo.png"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fdevmentors%2FDNC-DShop%2Fraw%2Fmaster%2Fassets%2Fdevmentors_logo.png" alt="DevMentors"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;&lt;strong&gt;What is Distributed .NET Core?&lt;/strong&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;It's an open source project (and a course available soon at &lt;a href="https://devmentors.io" rel="nofollow noopener noreferrer"&gt;devmentors.io&lt;/a&gt;), providing in-depth knowledge about building microservices using &lt;a href="https://www.microsoft.com/net/learn/get-started-with-dotnet-tutorial" rel="nofollow noopener noreferrer"&gt;.NET Core&lt;/a&gt; framework and variety of tools. One of the goals, was to create a cloud agnostic solution, that you shall be able to run anywhere.&lt;/p&gt;
&lt;p&gt;We encourage you to join our &lt;a href="https://www.discourse.org" rel="nofollow noopener noreferrer"&gt;Discourse&lt;/a&gt; forum available at &lt;a href="https://forum.devmentors.io" rel="nofollow noopener noreferrer"&gt;forum.devmentors.io&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For this particular course, please have a look at the topics being discussed under this &lt;a href="https://forum.devmentors.io/c/courses/distributed-dotnet-core" rel="nofollow noopener noreferrer"&gt;category&lt;/a&gt;.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;&lt;strong&gt;What topics will be discussed?&lt;/strong&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;A lot of them, covering different aspects of building distributed services, whether it comes to implementing the code, managing services discovery and load balancing, configuring logging or monitoring, and eventually deploying to the VM using Docker.&lt;/p&gt;
&lt;p&gt;Just to name a few:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.restapitutorial.com" rel="nofollow noopener noreferrer"&gt;RESTful API&lt;/a&gt; implementation with &lt;a href="https://docs.microsoft.com/en-us/aspnet/core/?view=aspnetcore-2.1" rel="nofollow noopener noreferrer"&gt;ASP.NET Core&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://dddcommunity.org" rel="nofollow noopener noreferrer"&gt;Domain Driven Design&lt;/a&gt; fundamentals&lt;/li&gt;
&lt;li&gt;SQL and NoSQL databases (&lt;a href="https://www.microsoft.com/en-us/sql-server/sql-server-2017" rel="nofollow noopener noreferrer"&gt;SQL Server&lt;/a&gt;, &lt;a href="https://www.mongodb.com" rel="nofollow noopener noreferrer"&gt;MongoDB&lt;/a&gt;, &lt;a href="https://www.influxdata.com" rel="nofollow noopener noreferrer"&gt;InfluxDB&lt;/a&gt;…&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/devmentors/DNC-DShop" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h3&gt;
  
  
  3) A vibrant community
&lt;/h3&gt;

&lt;p&gt;Dariusz and Piotr are two pillars of the project, but everyone is being invited to the project's contribution. There are several forms to get involved in the project like &lt;a href="https://forum.devmentors.io/" rel="noopener noreferrer"&gt;forum&lt;/a&gt;, &lt;a href="https://gitter.im/devmentors-io" rel="noopener noreferrer"&gt;Gitter&lt;/a&gt; or &lt;a href="https://twitter.com/dev_mentors" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;. Feel free to take the most suitable communication channel for you. You can ask a question to guys or propose a change. &lt;/p&gt;

&lt;h3&gt;
  
  
  4) An Youtube channel
&lt;/h3&gt;

&lt;p&gt;Honestly, I think that this the most significant feature of the DShop project. Why do I feel so? IMHO it brings the educational value. In each episode, Dariusz and Piotr are explaining the core concepts of a Microservice Architecture by an example. They are making a quick introduction to the problem and solving it before our eyes. Yes, guys are coding and recording at the same time. At the moment of writing this post, seven episodes are recorded. They are listed below:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Episode 1 - Intro, HTTP, requests flow, Infrastructure with Docker&lt;/li&gt;
&lt;li&gt;Episode 2 - CQRS - Write side, Discounts service, MongoDB repository&lt;/li&gt;
&lt;li&gt;Episode 3 - Subscribing RabbitMQ messages, API gateway&lt;/li&gt;
&lt;li&gt;Episode 4 - Asynchronous microservices integration via events&lt;/li&gt;
&lt;li&gt;Episode 5 - CQRS - Read side, Internal HTTP communication&lt;/li&gt;
&lt;li&gt;Episode 6 - Sevice discovery &amp;amp; load balancing with Consul and Fabio&lt;/li&gt;
&lt;li&gt;Episode 7- Handling asynchronous requests, SignalR, Polly&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Below is the link to the first episode.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/s4fd3PRlOcw"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  5) DShop is still being developed
&lt;/h3&gt;

&lt;p&gt;The project isn't dead. Dariusz and Piotr are enhancing the project. They are adding new features, refactoring old code, recording new youtube's episodes. I keep my fingers crossed to keep them enthusiastic and continue they work. &lt;/p&gt;




&lt;h2&gt;
  
  
  Closing
&lt;/h2&gt;

&lt;p&gt;It's obvious that the Microservice Architecture isn't an easy topic. Dariusz and Piotr assumed that average contributor has basic knowledge about Docker and RabbitMq. They don't dive deep into details of those technologies. In my opinion, it's good to get familiar with these tools (especially Docker). With this knowledge, we can focus on the architecture rather than the tool itself.  Please don't worry, without the experience in Docker and Rabbit you will be able to understand the main concepts, but it could be a little harder. &lt;/p&gt;

&lt;p&gt;The last thing I'd like to mention is that I'm glad there are developers like Dariusz and Piotr which want to share their knowledge with the community. Thanks them for that. &lt;/p&gt;

</description>
      <category>microservices</category>
      <category>architecture</category>
      <category>opensource</category>
      <category>ddd</category>
    </item>
    <item>
      <title>The hidden value of the Value Object</title>
      <dc:creator>Rafal Pienkowski</dc:creator>
      <pubDate>Fri, 17 Aug 2018 15:47:45 +0000</pubDate>
      <link>https://forem.com/rafalpienkowski/the-hidden-value-of-the-value-object-1hga</link>
      <guid>https://forem.com/rafalpienkowski/the-hidden-value-of-the-value-object-1hga</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;After my lecture on Vaughn Vernon's "Implementing Domain-Driven Design.", I've decided to write a post which will be connected with DDD and draw attention to the underestimated Value Objects. In my experience, developers are abusing Entities in their projects. Very often that behavior ends with an occurrence of many anemic domain models without or with little business logic. In my opinion, some of the anemic domain models could be quickly transformed into the Value Objects.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: All examples are written in C#, and they are using newest C# syntax. I hope they would be easy to understand also for developers who are using different languages.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Example:
&lt;/h3&gt;

&lt;p&gt;Let's start with the simple example of a Car entity like in the code snippet below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class Car
{
    /* Properties */
    public string Color { get; set; }
    public bool Metallic { get; set; }

    public string FuelType { get; set; }
    public int EngineCapacity { get; set; }
    { ... }

    /* Methods */
    public void Drive(int distance) { ... }
    { ... }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We will focus on properties related to car's color. I mean Color and Metallic property. For simplification, color is represented by string type.&lt;/p&gt;

&lt;h1&gt;
  
  
  Characteristic of the Value Object:
&lt;/h1&gt;




&lt;h3&gt;
  
  
  1) Measures, quantifies or describes the subject of a domain
&lt;/h3&gt;

&lt;p&gt;In our example, &lt;code&gt;Color&lt;/code&gt; and &lt;code&gt;Metallic&lt;/code&gt; are the best candidates for the Value object.  Both are describing the look of the vehicle.  So extract the new class:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class Color
{
    public string Hue { get; set; }
    public bool Metallic { get; set; }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Whenever &lt;code&gt;Hue&lt;/code&gt; or &lt;code&gt;Metallic&lt;/code&gt; changes we receive a new color, so let's go to the next point.&lt;/p&gt;

&lt;h3&gt;
  
  
  2) Is immutable
&lt;/h3&gt;

&lt;p&gt;Immutability means that object state cannot be changed after it's initialization. In Java or C# this could be achieved by passing all parameters to the constructor of a value object. Based on the values of parameters state of the object will be set up. Of course based on values some additional properties could be calculated. &lt;br&gt;
&lt;em&gt;Notice:&lt;/em&gt; The object itself can't call property setters either by the public, nor the private methods. This is forbidden.&lt;/p&gt;

&lt;p&gt;Let's enhance our example according to previous thoughts.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class Color
{
    public Color(string hue, bool metallic)
    {
        Hue = hue;
        Metallic = metallic;
        if (hue == "white" &amp;amp;&amp;amp; !metallic)
        {
            BasicPallete = true;
        }
     }

    public string Hue { get; }
    public bool Metallic { get; }
    public bool BasicPallete { get; }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the example above we've calculated the &lt;code&gt;BasicPallete&lt;/code&gt; property. For example, it could influence a car's price calculation.&lt;/p&gt;

&lt;h3&gt;
  
  
  3) Composes linked attribute values into the integral unit
&lt;/h3&gt;

&lt;p&gt;This means that all properties are bounded, and each provides the crucial part of the information which describes the whole value of the object. Individual property value doesn't provide comprehensive information about the object. In our case knowledge about that if a color is metallic or not doesn't give us information about its hue. The same situation is when we know hue, but we don't know if it's metallic or not.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Worth is a perfect example cited often by this point. Let's take 100 USD as an example. Currency and amount are linked together. Let's imagine that someone has changed the currency from USD to MXN (Mexican Peso) in our object. That change has the significant impact. 100 MXN is worth approximately 5.25 USD. Oneone wants to be a victim of such a small change.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  4) Is replaceable in the situation when the measurement changes
&lt;/h3&gt;

&lt;p&gt;In our case car is an entity and color is a value object in our domain. Someday we decide to change the color of our car. Let's say we've bought a green non-metallic vehicle, but after a few years, we want to have a green metallic one. We cannot just add metallic gloss to existing painting. We need to repaint it with the new green metallic paint.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Color color = new Color("green", false);
//color.Metallic = true;  -&amp;gt; This is not allowed

color = new Color("green", true);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  5) Could be compared with other value objects
&lt;/h3&gt;

&lt;p&gt;In languages like C# when we try to compare two objects &lt;a href="https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/statements-expressions-operators/equality-comparisons" rel="noopener noreferrer"&gt;by default&lt;/a&gt;, the comparison covers the location in memory of two objects (called &lt;a href="https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/statements-expressions-operators/how-to-test-for-reference-equality-identity" rel="noopener noreferrer"&gt;Reference Equality&lt;/a&gt;). Two objects can have the same property values, but the will not be equal. This is the wrong assumption regarding the Value Objects.  In that case, we need to have equality of given type and all property values (called &lt;a href="https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/statements-expressions-operators/how-to-test-for-reference-equality-identity" rel="noopener noreferrer"&gt;Value Equality&lt;/a&gt;). &lt;/p&gt;

&lt;p&gt;According to our example, two colors are the same if they have the same hue and are metallic or not. Two cars which are green and metallic have the same color. &lt;/p&gt;

&lt;p&gt;So let enhance our class and implement the Value Equality:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class Color
{
    public Color(string hue, bool metallic)
    {
        Hue = hue;
        Metallic = metallic;
        if (hue == "white" &amp;amp;&amp;amp; !metallic)
        {
            BasicPallete = true;
        }
    }

    public string Hue { get; }
    public bool Metallic { get; }
    public bool BasicPallete { get; }

    public override bool Equals(object obj)
    {
        return this.Equals(obj as Color);
    }

    public bool Equals(Color otherColor)
    {
        if (Object.ReferenceEquals(otherColor, null)) return false;
        if (Object.ReferenceEquals(this, otherColor)) return true;
        if (this.GetType() != otherColor.GetType()) return false;

        return (Hue == otherColor.Hue) &amp;amp;&amp;amp; (Metallic == otherColor.Metallic);
    }

    public static bool operator ==(Color leftColor, Color rightColor)
    {
        if (Object.ReferenceEquals(leftColor, null))
        {
            // null == null = true
            return (Object.ReferenceEquals(rightColor, null));
        }
        return leftColor.Equals(rightColor);
    }

    public static bool operator !=(Color leftColor, Color rightColor)
    {
        return !(leftColor == rightColor);
    }

    public override int GetHashCode()
    {
        return (Hue.GetHashCode() * 0x100000) + (Metallic.GetHashCode() * 0x1000) + BasicPallete.GetHashCode();
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  6) Has side-effect-free behavior
&lt;/h3&gt;

&lt;p&gt;This is the fundamental rule. Without it, Value object could be treated as a simple container for attributes. To understand it we should start with understanding side-effect-free function. Function without site effect has a result but doesn't modify its state. Such a function are fundamental in Functional Programming Paradigm. &lt;/p&gt;

&lt;p&gt;All methods exposed by a value object should be a function without side effect, which doesn't violate the value object's immutability.&lt;/p&gt;

&lt;p&gt;Let's take the car's repainting example. We can achieve repainting by adding such a function to our class.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class Color
{
    public Color(string hue, bool metallic)
    {
        Hue = hue;
        Metallic = metallic;
        if (hue == "white" &amp;amp;&amp;amp; !metallic)
        {
            BasicPallete = true;
        }
     }

    public string Hue { get; }
    public bool Metallic { get; }
    public bool BasicPallete { get; }

    public Color Repaint(string hue, bool metallic)
    {
        return new Color(hue, metallic);
    }

    // Value Equality part
    {...}
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As we can see, there is a similar effect like in car's repainting case. But the connection between method and value object is stronger and side-effect-free. We don't modify the state of the color object. Instead of that, we've created the new one with demanded values.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Color color = new Color("green", false);
color = color.Repaint("green", true);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Summary
&lt;/h1&gt;

&lt;p&gt;Of course, I didn't cover all topics related to Value Objects, all the more DDD, but I hope this post will inspire you to use it more often in your projects.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frtu1slk1yz6yho7puasy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frtu1slk1yz6yho7puasy.png" alt="Keep calm and use Value Objects" width="600" height="700"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;P.S.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Please don't go from one extreme to the other.&lt;/p&gt;

&lt;h1&gt;
  
  
  Links:
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/rafalpienkowski/resources/blob/master/hidden-value-of-the-value-object/Color.cs" rel="noopener noreferrer"&gt;Color.cs class&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/rafalpienkowski/resources/blob/master/hidden-value-of-the-value-object/ColorStruct.cs" rel="noopener noreferrer"&gt;Color.cs readonly struct&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.microsoft.com/en-us/dotnet/standard/microservices-architecture/microservice-ddd-cqrs-patterns/implement-value-objects" rel="noopener noreferrer"&gt;Implementing value objects&lt;/a&gt; from .NET Guide&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://martinfowler.com/bliki/EvansClassification.html" rel="noopener noreferrer"&gt;Evans Classification&lt;/a&gt; from MartinFowler.com&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://martinfowler.com/bliki/ValueObject.html" rel="noopener noreferrer"&gt;Value Object&lt;/a&gt; from MartinFowler.com which contains examples written in Java&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ddd</category>
      <category>productivity</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Do we need standup?</title>
      <dc:creator>Rafal Pienkowski</dc:creator>
      <pubDate>Mon, 13 Aug 2018 12:45:31 +0000</pubDate>
      <link>https://forem.com/rafalpienkowski/do-we-need-stand-up-h19</link>
      <guid>https://forem.com/rafalpienkowski/do-we-need-stand-up-h19</guid>
      <description>&lt;p&gt;Some time ago I read &lt;a href="https://medium.com/@jsonpify/you-dont-need-standup-9a74782517c1"&gt;an interesting article&lt;/a&gt; about agile methodology made by an engineering lead at Spotify. As we know, agile is a tool which should suit needs of a team. The author of the article has run a six-month experiment and has reduced number of meetings in his agile team. &lt;/p&gt;

&lt;p&gt;He has introduced, let's call it "minimal meeting" rule which covers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  No stand-ups&lt;/li&gt;
&lt;li&gt;  No planning at regular intervals&lt;/li&gt;
&lt;li&gt;  No retros&lt;/li&gt;
&lt;li&gt;  All meetings are optional&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://medium.com/@jsonpify/you-dont-need-standup-9a74782517c1"&gt;The article&lt;/a&gt; describes the author's motivation which was standing behind his decision, so I don't like to repeat his arguments.  You can read it of our own.&lt;/p&gt;

&lt;h3&gt;
  
  
  My opinion
&lt;/h3&gt;

&lt;p&gt;"Minimal meeting" rule is too extreme for me because I'm working in teams which are located in offices across various locations. In my opinion, enforcing team members to communicate with each other is essential in daily work, and I can't imagine such a free approach to team meetings.&lt;/p&gt;

&lt;p&gt;On the other hand, this experiment is an excellent example of how agile the Agile methodology is and how it could be adapted to current team needs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Let's discuss
&lt;/h3&gt;

&lt;p&gt;I'm extremely curious what is your opinion. Do you think will the "minimal meeting" rule work in your teams? Would you like to perform such an experiment in your organizations?&lt;/p&gt;

</description>
      <category>agile</category>
      <category>discuss</category>
      <category>productivity</category>
    </item>
    <item>
      <title>GitHub &amp; Docker Hub a reasonable marriage</title>
      <dc:creator>Rafal Pienkowski</dc:creator>
      <pubDate>Tue, 07 Aug 2018 15:01:10 +0000</pubDate>
      <link>https://forem.com/rafalpienkowski/github--docker-hub-a-reasonable-marriage-373k</link>
      <guid>https://forem.com/rafalpienkowski/github--docker-hub-a-reasonable-marriage-373k</guid>
      <description>&lt;p&gt;Some time ago I posted an article about configuring CI/CD with &lt;a href="https://wercker.com/" rel="noopener noreferrer"&gt;Wercker&lt;/a&gt;. &lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/rafalpienkowski" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F38515%2F7940efde-6e57-4e08-a3b4-054aa616e4bf.png" alt="rafalpienkowski"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/rafalpienkowski/cicd-with-wercker--51k" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;CI/CD with Wercker&lt;/h2&gt;
      &lt;h3&gt;Rafal Pienkowski ・ Mar 9 '18&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#productivity&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#devops&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#docker&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#deployment&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;Now I decided to try out a Docker Hub's automated build functionality. I need to say that I'm positively surprised. It's easy and can be useful in some scenarios. &lt;/p&gt;

&lt;p&gt;The option for an "Automated Build" is a bit hidden after "Create" button, but the whole process of creation of a new Docker Hub automated build is easy and can see in the picture below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Frafalpienkowski%2Fresources%2Fmaster%2Fgithub-docker-hub-marriage%2Fcreation.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Frafalpienkowski%2Fresources%2Fmaster%2Fgithub-docker-hub-marriage%2Fcreation.gif" alt="Automated build creation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Notice:&lt;/em&gt; As you can see there is an option to take a Bitbucket repository too.&lt;/p&gt;

&lt;p&gt;The process ends with an automated build instead of a repository. Compared to a repository automated build contains more options:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dockerfile
We can see what docker file has been used&lt;/li&gt;
&lt;li&gt;Build Details
We have the history of our builds. We can also look into details of every build. Additionally, we have a link to the GitHub repository with source code.&lt;/li&gt;
&lt;li&gt;Build Settings
We can change the image's tag depending on source code branch, trigger build manually or set up a build trigger depending on a tag in the source code.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Frafalpienkowski%2Fresources%2Fmaster%2Fgithub-docker-hub-marriage%2Fdashboard.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Frafalpienkowski%2Fresources%2Fmaster%2Fgithub-docker-hub-marriage%2Fdashboard.png" alt="Automated build tabs"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By default, the build will be triggered after every commit to the master branch on the GitHub. It takes some time to start a build and publish an image into our repository. The whole setup of an automated build ends with proper Dockerfile creation. Dockerfile can be tested on our local machine before we make a commit into the GitHub repository.&lt;/p&gt;

&lt;p&gt;In my opinion, copying README.md file from GitHub and pasting it into Full Description in the Repo info tab is the killer feature. I love it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does it cover all requirements?
&lt;/h3&gt;

&lt;p&gt;The simple answer is no. Sorry, but in my opinion, the functionality doesn't meet all expectations for a production-ready solution. For instance, we couldn't set up a CI workflow with steps containing build, unit and integration tests and deploy to a repository which is crucial nowadays.&lt;/p&gt;

&lt;h3&gt;
  
  
  For whom the functionality is dedicated?
&lt;/h3&gt;

&lt;p&gt;I think that for any Proof of Concept (PoC) project, a side project which can be developed separately or in case we need to prepare some dedicated docker images for our use.&lt;/p&gt;

&lt;h3&gt;
  
  
  Last words
&lt;/h3&gt;

&lt;p&gt;That is my subjective opinion. Feel free to disagree with me. I'm also interested in your opinion especially if you took advantage of that functionality. If you have any other ideas for usage of this functionality, give your suggestion in the comments.&lt;/p&gt;

&lt;p&gt;Cheers.&lt;/p&gt;

</description>
      <category>docker</category>
      <category>github</category>
      <category>productivity</category>
      <category>devops</category>
    </item>
    <item>
      <title>Can you share your favorite quote or rule related to IT?</title>
      <dc:creator>Rafal Pienkowski</dc:creator>
      <pubDate>Fri, 08 Jun 2018 08:38:30 +0000</pubDate>
      <link>https://forem.com/rafalpienkowski/can-you-share-your-favorite-quote-or-rule-related-to-it-4e7l</link>
      <guid>https://forem.com/rafalpienkowski/can-you-share-your-favorite-quote-or-rule-related-to-it-4e7l</guid>
      <description>&lt;p&gt;I like quotes and funny rules. A good quote makes our presentation more interesting, draws attention to the presenter and makes the presentation unforgettable. Ridiculous or easy-to-remember rules help us keep in mind essential things. &lt;/p&gt;

&lt;p&gt;Below one of my favorites:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Quote&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"A language that doesn't affect the way you think about programming is not worth knowing."&lt;br&gt;
&lt;a href="https://en.wikipedia.org/wiki/Alan_Perlis"&gt;Alan Perlis&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Rule&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"A team shouldn't be larger than what two pizzas can feed."&lt;br&gt;
&lt;a href="https://en.wikipedia.org/wiki/Jeff_Bezos"&gt;Jeff Bezos&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now it's your turn to share your quotes and rules related to IT ;)&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>Poor man's dotnet solution setup</title>
      <dc:creator>Rafal Pienkowski</dc:creator>
      <pubDate>Sun, 15 Apr 2018 11:06:02 +0000</pubDate>
      <link>https://forem.com/rafalpienkowski/poor-mans-dotnet-solution-setup-1g7l</link>
      <guid>https://forem.com/rafalpienkowski/poor-mans-dotnet-solution-setup-1g7l</guid>
      <description>&lt;p&gt;Some time ago I started my journey into a Linux with dotnet Core. &lt;/p&gt;

&lt;p&gt;Initially, I planned to describe how to set up a working solution, but I've found &lt;a href="https://dev.to/ruidfigueiredo/aspnet-core-development-in-linux-fge"&gt;an article&lt;/a&gt;  about this here on dev.to. In my opinion. &lt;a href="https://dev.to/ruidfigueiredo"&gt;Rui&lt;/a&gt; covers almost all important things which I had planned to describe. If you don't know how to start ASP.NET Core Development in Linux, I encourage to read his article. Well done Rui!&lt;/p&gt;

&lt;p&gt;Because I have nothing to add in that subject, I've decided to focus on another one. In my &lt;a href="https://dev.to/rafalpienkowski/a-net-man-in-linux-world-i66"&gt;previous article&lt;/a&gt; some of you've suggested me to use &lt;a href="https://www.jetbrains.com/rider/"&gt;Jetbrain's Rider IDE&lt;/a&gt;. Maybe in the future, I'll buy it, especially if I decide to switch from Windows to Linux/iOS. I think that in such case is reasonable to spend about 350$ for an IDE. For now, for my side projects, I'm going to focus on VS Code. &lt;/p&gt;

&lt;p&gt;The thing which made me crazy was a project initialization. I fed up with continuous typing of the same command-line commands to set up a new solution. Like every developer, I'm a lazy person.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/VjWNQMfCIHxS0/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/VjWNQMfCIHxS0/giphy.gif" alt="Lazy"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To avoid doing this boring stuff over and over again, I've decided to write a bash script which will do all that tedious staff instead of me. The source code of it could be found on my &lt;a href="https://github.com/rafalpienkowski/bash-extensions"&gt;GitHub repo&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This script creates a basic solution's folder structure. It initializes main project and dedicated test project. Created test project contains the reference to the main project. It has also referenced two advantageous (at least in my opinion) NuGet packages: &lt;a href="https://fluentassertions.com"&gt;FluentAssertions&lt;/a&gt; and &lt;a href="https://github.com/Moq/moq4/wiki/Quickstart"&gt;Moq&lt;/a&gt;. It creates sln file which could be beneficial for devs which plan to open the solution via full Visual Studio. In the end, Visual Studio Code will be opened.&lt;/p&gt;

&lt;p&gt;Usage:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dotnet-solution [solution-name] [main-project-name] &amp;lt;&amp;lt;template&amp;gt;&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The template is passed to the [dotnet new] command. It will be used to create the new dotnet project based on it. More about templates you can be found under this &lt;a href="https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-new"&gt;link&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dotnet-solution adventure-works AdventureWorks.Common classlib
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Solution structure which will be created by the example above. I've intentionally omitted some meaningless folders.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;+-- adventure-works
|   +-- src
|       +-- AdventureWorks.Common
|       |   +-- Class1.cs
|       |   +-- AdventureWorks.Common.csproj
|   +-- test
|       +-- AdventureWorks.Common.Tests
|       |   +-- UnitTest1.cs
|       |   +-- AdventureWorks.Common.Tests.csproj
+-- adventure-works.sln
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For those who are not familiar with Linux/Unix systems, to add a specific extension to your bash shell you need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;download it to your machine&lt;/li&gt;
&lt;li&gt;copy to /usr/bin catalog (admin rights will be required)&lt;/li&gt;
&lt;li&gt;make it executable by &lt;em&gt;chmod&lt;/em&gt; command (admin rights will be required)
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    chmod +x dotnet-solution
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Feel free to copy, use and modify those scripts. I'm also open to all your suggestions and propositions. Please keep in mind that was my first steps in bash scripting. I hope it can be handy for you.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>coding</category>
      <category>dotnet</category>
      <category>linux</category>
    </item>
  </channel>
</rss>
