dotnetomaniak.pl

dotnetomaniak.pl - Artykuły z tagiem design patterns

"The code that a computer can understand can be written by anyone. A good programmer writes code that people can understand."

Dziel się z innymi:
Why I cannot understand this code?

Sztuka programowania 49 dni, 8 godzin, 18 minut temu kw677 167 rozwiń

How often in your code do you see ifs checking whether the object is not null? Often? Very often? What would happen if you didn’t have to check it out? Surely code would be easier to maintain – no ifs = no test cases. This can all be achieved using Null Object pattern.

Null Object pattern - how and when to use it | mpustelak.com

Sztuka programowania 217 dni, 10 godzin, 26 minut temu Mateusz Pustelak 249 rozwiń

Druga część przeglądu źródeł .NET Core. Tym razem poszukujemy wzorców strukturalnych.

Źródło: mickl.net
Dziel się z innymi:
Wzorce projektowe w źródłach .NET: 2/3 wzorce strukturalne

Architektura 242 dni, 8 godzin, 40 minut temu mickl 193 rozwiń

W źródłach .NET poszukujemy zastosowań wzorców projektowych. Mało tekstu, zero UML, dużo kodu.

Źródło: mickl.net
Dziel się z innymi:
Wzorce projektowe w źródłach .NET: 1/3 wzorce kreacyjne

Architektura 246 dni, 9 godzin, 27 minut temu mickl 399 rozwiń

Today I’ll show you a quite nice example of the Strategy pattern from a real project I was working on some time ago.

Strategy design pattern - real life example - PoznajProgramowanie.pl

Sztuka programowania 250 dni, 15 godzin, 20 minut temu AdrianBystrek 187 rozwiń

Design patterns which I would like to present in this post are well described in the book Design Patterns. Elements of Reusable Object-Oriented Software  written by The Gang of Four (Gramma, Helm, Johnson, Vlissides). In my opinion this book is must read for every developer, regardless what programming language you are using. Besides the fact that this book was written more than 20 years ago, it still contains a lot of useful details for developers of all levels. I often revisit this book to keep in touc...

Design Patterns – introduction | mpustelak.com

Sztuka programowania 267 dni, 8 godzin, 18 minut temu Mateusz Pustelak 140 rozwiń

Zaczynając swoją przygodę z ASP.NET MVC (oraz w ogóle z programowaniem) miałem sporo problemów z utrzymaniem porządku w moich akcjach na kontrolerach. Bardzo często pojawiało się tam mnóstwo warunków i niepotrzebnej logiki. Ten problem trzeba było sensownie rozwiązać, więc z kolegami wypracowaliśmy sobie pewną konwencję, której twardo się trzymaliśmy...

Źródło: lmarcinek.pl
Dziel się z innymi:
ASP.NET MVC: Method chaining w kontrolerach | Łukasz Marcinek

Web 378 dni, 22 godziny, 39 minut temu Łukasz Marcinek 433 rozwiń

Which one of us doesn’t like to give commands? It’s the natural way to ask (in a polite way) for a specific task that needs to be completed. Therefore, it shouldn’t be surprising that the command pattern can be also easily implemented within our software, which might provide some serious benefits in terms of loose coupling the existing code.

Dziel się z innymi:
I command you (pattern) | Piotr Gankiewicz

Sztuka programowania 381 dni, 18 godzin, 39 minut temu spetz 220 rozwiń

Do you ever feel like (well, you should) these huge switch + case statements or too many ifs seem to be wrong? What if I told you, there’s one simple trick that will change your life, by getting rid of them? Ok, seriously – I have nothing against switch or if as the way of controlling the flow (I use them quite often) however, there are certain occasions at which the things could be done better. And let me show you another way to achieve the same goal which is much cleaner in terms of code readability a...

Dziel się z innymi:
Get rid of switch/case/if | Piotr Gankiewicz

Sztuka programowania 401 dni, 18 godzin, 7 minut temu spetz 354 rozwiń

In this post I will try to introduce the concept of validation using the Chain of Responsibility pattern (CoR), which I use successfull for years

[EN] Chain of Responsibility – an elegant way to handle complex validation

Sztuka programowania 448 dni, 20 godzin, 20 minut temu pluksza 218 rozwiń

Immutability is a quite old concept that is mostly related to the functional programming, however, it’s also (maybe not so widely) used in the object oriented programming. An immutable variable/object can not be mutated, which means that once it’s been initialized it will never change it’s original value/reference (unless it’s deallocated). This approach results in some great benefits such as out of the box thread safety, yet in the OOP world, it does seem to be quite often abused or even not used at al...

[EN] A word about immutability | Piotr Gankiewicz

Sztuka programowania 498 dni, 19 godzin, 36 minut temu spetz 68 rozwiń

Recently I’ve had this idea that came into my mind while working on the Sentry – let the users of my library (if there will be any) to configure not only the set of rules, connection strings, urls etc. but also the underlying providers that do all of the heavy lifting (e.g. the HttpClient responsible for communicating with the API). It means that as long as you’re not satisfied with the default solution, please feel free to provide your own engine that will for example talk to the database and perform a ...

[EN] Mocking the “unmockable” | Piotr Gankiewicz

Sztuka programowania 507 dni, 19 godzin, 54 minuty temu spetz 82 rozwiń

CQS stands for the command query separation. There’s a chance that you may have not heard about it, but on the other hand the CQRS might ring a bell. Even though these 2 patterns have very much in common, there is a significant difference (definitely a bigger one than the additional “R” character within the CQRS acronym) in how do they apply to the architecture of our system. In this post I’ll focus on the CQS – the older brother of the CQRS – that will help you understand how to design the software that...

Dziel się z innymi:
[EN] CQS – an easy, yet powerful pattern | Piotr Gankiewicz

Sztuka programowania 518 dni, 15 godzin, 49 minut temu spetz 148 rozwiń

In one of my previous posts I’ve told about my feelings for the repository pattern. Complaining about something is one thing (please, don’t even try to tell me, that you have never seen some piece of code, that made you cry like a baby), however, if we want to (pretend to) be professionalists, it is very important to come up with some ideas in order to solve the given problem (at least partially). In this post, I’ll present to you one of my solutions to the commonly misused repository pattern.

[EN] Extension methods to the rescue (from repository) | Piotr Gankiewicz

Architektura 526 dni, 6 godzin, 22 minuty temu spetz 129 rozwiń

Many of the programmers falls into the trap of creating too many unnecessary abstractions in code, that may introduce even more chaos and maintenance issues, instead of simplifying overall project structure and providing some real benefit. One of such abstractions, that have been discussed countless number of times, is the (one and only) repository pattern.

Dziel się z innymi:
[EN] Repository, so we meet again. | Piotr Gankiewicz

Architektura 528 dni, 5 godzin, 8 minut temu spetz 226 rozwiń

Today I want to introduce a Circuit Breaker – one of the reactive design patterns, especially useful in areas such as web services interop. They main role is to act as a decorator around your code to ensure, that you can quickly respond on any reliability problems.

Dziel się z innymi:
[EN] Design patterns: Circuit Breaker - Simple Solutions

Sztuka programowania 884 dni, 14 godzin, 27 minut temu Horusiath 143 rozwiń

Today I want to present a different point of view on C# applications design. If you are programming in that language most of the time, it’s probably not what you’re used to see. However I found it interesting, because it allows to achieve a few important goals...

Dziel się z innymi:
[C#] A different look at service design - Simple Solutions

Sztuka programowania 897 dni, 18 godzin, 58 minut temu Horusiath 297 rozwiń

Agile Principles, Patterns, and Practices in C# by Uncle Bob is the best book about modern Software Development I have ever read. First section (chapters 1-6) is an Overview of Agile, Extreme Programming (XP), and TDD. Very good introduction to modern software development. Chapter 6. shows all these techniques by example, by creating “The Bowling Game” application...

Źródło: jj09.net
Dziel się z innymi:
[EN] Agile Principles, Patterns, and Practices in C# - Jakub Jedryszek

Sztuka programowania 926 dni, 14 godzin, 14 minut temu jj09 242 rozwiń

Nieraz zdarza się, że musimy samodzielnie napisać jakąś klasę implementującą interfejs IDisposable. Wszyscy na pewno znają wzorzec implementowania Dispose. Osobiście proponuję inną implementację.

Źródło: rpajak.com
Dziel się z innymi:
Implementowanie IDisposable | Robert Pająk – Blog

Inne 1046 dni, 20 godzin, 35 minut temu Robert Pająk 493 rozwiń

Jednym z częściej opisywanych zagadnień na blogach programistycznych są wzorce projektowe. Często jednak ich opisy są bardzo krótkie, bez przykładów konkretnego zastosowania w prawdziwym kodzie, a czasem nawet niepoprawne. Dzisiaj przedstawię jak wykorzystanie wzorców projektowych może przyczynić się do ograniczenia powtórzeń w kodzie testów. Nie będzie to wprowadzenie do tych wzorców (opisanych setki razy w innych miejscach), ale opis moim zdaniem nietypowego ich zastosowania.

Wzorce projektowe w testach jednostkowych | Piotr Perak

Sztuka programowania 1179 dni, 6 godzin, 2 minuty temu trzyPe 238 rozwiń

1 2 3
Szkolenia SecurITum

wrzesień

08.
BBQ4IT
Bielsko-Biała
14.
devConf
Kraków
20.
Dodaj nowe Zobacz wszystkie

Najaktywniejsi

1

macko (32 816,53)

2

http://pawlos.blo... (31 777,5)

3

pzielinski (27 178,29)

4

gordon_shumway (21 178,87)

5

paduda (20 336,33)

6

psz750 (13 018,14)

7

rroszczyk (10 386,33)

8

Damian (9 111,11)

9

danielplawgo (7 235,99)

10

arek (6 807,95)

11

burczu (6 214,22)

12

PaSkol (5 393,84)

13

lukaszgasior (4 097,38)

14

jj09 (3 643,06)

15

jedmac (3 318,39)

16

spetz (3 238,29)

17

http://jakub-flor... (3 224,66)

18

CaMeL (2 954,87)

19

lkurzyniec (2 672,96)

20

dpawlukiewicz (2 619,93)