Blog programistyczny

Paweł Filipek

Observer patter

Observer patter

Observer pattern Today, I will try to present a observer pattern.It is part of behavioral patterns and is relatively simple so I think it’s worth it to present. Subject – the object of which we want to obtain information Observer – objects pending notification of the change in the observed object When we use it? When we have object(subject)Więcej oObserver patter[…]

State pattern

State pattern

State patter Design pattern, which aims to facilitate the extension of the building of the new states. With the change of state is changing the behavior of object. States are temporary objects, they have a common interface and they are associated with a particular object(context). We use it where we have a lot of conditionalWięcej oState pattern[…]

Simple Data – Example with compare

Simple Data – Example with compare

Simple Data Simple.Data is dynamic ORM. But What mean ORM : O – object, R – Relational, M – Mapping. But if simple data is dynamic we haven’t objects, relationals, mapping. So try again „Simple.Data is dynamic (NullReferenceException)” – weak joke 😉 Today I will try to compare Simple.Data with EntityFramework. Example The example uses two tables „team” andWięcej oSimple Data – Example with compare[…]

Refactoring with TDD – „Currency example”

Refactoring with TDD – „Currency example”

Today, I’ll show a program based on a TDD approach which I explained in a previous article. At the beginning it will have two classes representing two currencies „złoty” and „euro”. I’ll test the multiplication money and compare them like –  one euro is equal to one złoty. And every time I try to refactoring our code – remove duplications. Currency projectWięcej oRefactoring with TDD – „Currency example”[…]

Loading data from excel and display them with Paged List MVC

Loading data from excel and display them with Paged List MVC

Today’s post will be different because it will be in English language. I’ll write a simple application MVC with data import from excel and displey them on the page(View) with „Paged List MVC”. OK, so let’s try it. Loading data from excel In a first step is to create model:

Our example will beWięcej oLoading data from excel and display them with Paged List MVC[…]

Wstrzykiwanie zależności i kontener Windsor Castle

Wstrzykiwanie zależności i kontener Windsor Castle

Wstrzykiwanie zależności i biblioteka Windsor Castle. Dzięki zastosowaniu tych dwóch rzeczy możemy naszą aplikacje przekształcić w kod prosty i zrozumiały poprzez zależności. Dodatkowo przy zastosowaniu kontenerów (Windsor Castle) dostajemy gotowy obiekt wraz ze wszystkimi przypisanymi mu zależnościami bez pisania zbędnego i powtarzającego się kodu. Możemy w łatwy sposób napisać testy do takiej aplikacji wspierając równieżWięcej oWstrzykiwanie zależności i kontener Windsor Castle[…]