dotnetomaniak.pl - Artykuły z tagiem design patterns

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 2950 dni, 9 godzin, 36 minut temu spetz 83 źrodło 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 2961 dni, 5 godzin, 31 minut temu spetz 175 źrodło 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 2968 dni, 20 godzin, 4 minuty temu spetz 130 źrodło 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 2970 dni, 18 godzin, 50 minut temu spetz 235 źrodło 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 3327 dni, 4 godziny, 9 minut temu Horusiath 143 źrodło 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 3340 dni, 8 godzin, 40 minut temu Horusiath 297 źrodło 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 3369 dni, 3 godziny, 56 minut temu jj09 246 źrodło 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 3489 dni, 10 godzin, 17 minut temu Robert Pająk 500 źrodło 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 3621 dni, 19 godzin, 44 minuty temu trzyPe 240 źrodło rozwiń

Kiedyś przeczytałem o antypaternie jakim jest tworzenie nowego typu wyjątku, który jest per aktualny projekt, czyli np. GitHubException, ktory dziedziczy z System.Exception i nie dodaje własnych pól ani zachowania. Tworzymy go ponieważ wszystko co już jest nie pasuje nam, a wiadomo, że rzucanie Exception też jest złem. Taki wyjątek nic nie wnosi. Łatwo powiedzi...

Rzucanie własnych wyjątków specyficznych dla aplikacji | Show me the code

Sztuka programowania 3797 dni, 23 godziny, 25 minut temu Paweł Łukasik 266 źrodło rozwiń

Chciałem przypomnieć prezentację Pawła Łukasika zatytułowaną Kurs programowania w C# – 24. Wzorce projektowe, która została nagrana 1,5 roku temu na VirtualStudy. Dużo się z niej nauczyłem zwłaszcza o antyzworcach. Ostatecznie pytanie o wzorce na pewno pojawi się na rozmowie o pracę, jeśli ktoś ma wątpliwości czy warto. Chociaż fakt lepszego zrozumienia jednego z najważniejszych pojęć powinien wystarczyć. Poniższy ry...

Wzorce i antywzorce projektowe w C# | Show me the code

Sztuka programowania 3800 dni, 8 godzin, 6 minut temu Paweł Łukasik 658 źrodło rozwiń

by MJ Decorator is a design pattern used to dynamically ”decorate” (e.g. add new actions) another classes. Let’s say that you have class which describes Window. It can be opened or closed. Then, you decide to decorate it with curtains or to clean it – you  will do it yourself or hire somebody, who will be a decorator. Let’s create a simple project: 1) First of all, you need to add “Decorator” folder. Inside of this folder please create Window.cs class which will describe our window in the real world...

[EN] World of IT | Design Patterns – Decorator

Architektura 3843 dni, 3 godziny, 44 minuty temu jedmac 164 źrodło rozwiń

by MJ Prototype design pattern. You should use it whenever you need to clone model classes. A simple example is when you have 1000 clients and you need to provide them invoices. Then, you only need to change e,g, names, surnames and total amount – you don’t need to create another invoice from the beginning. Again, the same situation is when your class is a parent for other classes – in this situation, it is not easy to create new – you should clone existing instance and then try to modify it. Here is a...

[EN] World of IT | DESIGN PATTERNS – PROTOTYPE

Architektura 3843 dni, 10 godzin, 32 minuty temu jedmac 117 źrodło rozwiń

by MJ Facade is one of design patterns which are used most frequently. To explain what it is and how to use it, we can compare it to a black box. In black box test, tester is only allowed to create the input and get the output. He doesn’t know anything about processing inside of the system. You will meet similar situation in Facade – you don’t want to show out the whole functionality, you need to create some kind of interface which enables user to use the functonality, but he  cannot look into the syste...

[EN] World of IT | Design Patterns – Facade

Architektura 3847 dni, 23 godziny, 15 minut temu jedmac 176 źrodło rozwiń

Posted by slanto on Zastosowanie wzorca Decorator na przykładzie produktu i ofert specjalnych. Wzorzec ten pozwala nam na dynamiczną zmianę/rozszerzanie zachowania istniejących klas.

Dziel się z innymi:
Decorator Pattern | Zapiski programisty .net

Architektura 4358 dni, 11 godzin, 20 minut temu http://slanto.myopenid.com/ 289 źrodło rozwiń

O to jest pytanie. Używać czy nie używać Repository Pattern? Ostatnio troszkę się nad tym zastanawiałem i doszedłem do solidnego wniosku: tak i nie. :) Wiadomo, że ktoś zawsze powie: "to zależy". A ja mu przytaknę. W malutkim projekcie nie ma sensu. W większym? Chcąc być purystą powinienem zrealizować cały dostęp do danych poprzez wartwę realizowaną na bazie Repository Pattern. Czy to ma sens? Co jeśli chcę tylko wyciągnąć imię i nazwisko ostatnio dodanego użytkownika? Czy na prawdę muszę pisać te wszys...

Źródło: dario-g.com
Dziel się z innymi:
Dario-G | Używać czy nie używać Respository Pattern?

Architektura 4450 dni, 16 godzin, 42 minuty temu Paweł Łukasik 267 źrodło rozwiń

NULL Object Pattern (Special Case)

Dziel się z innymi:
NULL Object Pattern (Special Case)

Architektura 4521 dni, 9 godzin, 21 minut temu pzielinski 185 źrodło rozwiń

Tak mnie wzięło na wzorce projektowe ostatnimi czasy, dzisiaj coś o o odwiedzającym (wizytatorze). Polska Wikipedia mówi o nim tak odwiedzający.

jsthedeveloper: Wzorce: Odwiedzający / Wizytator

Architektura 4705 dni, 4 godziny, 14 minut temu Paweł Łukasik 274 źrodło rozwiń

Przeglądając wpisy na rożnych blogach oraz biorąc udział w dyskusjach na portalach,  częstokroć napotykałem na dyskusje jak prawidłowo zaimplementować wzorzec singletona. Jeden z częstszych podawanych przykładów prezentuje poniżej.public sealed class Singleton { static Singleton instance=null; static readonly object padlock = new object(); Singleton() { } public static Singleton Instance { get { if (instance==null) { lock ...

Dziel się z innymi:
Wzorzec Singletona dla C# | Łukasz Byczyński

Programowanie rozproszone środa, 28 października 2009 21:41:45 GMT LukaszByczynski 80 spam? źrodło rozwiń

Autor: Przypadkiem trafiłem na fajny cheetsheet zawierający zestawienie podstawowych  wzorców projektowych, może się komuś przyda :)

Źródło: dario-g.com
Dziel się z innymi:
Design Pattern - podstawowe wzorce na jednej karcie - Dario-G - programista, projektant

Architektura 5306 dni, 1 godzinę, 52 minuty temu macko 364 źrodło rozwiń

1 2 3

Najaktywniejsi w tym miesiącu