MVC)MJLeave a comment Dzisiaj krótki wpis, ale wydaje mi się, że wart uwagi. W zeszłym tygodniu po raz pierwszy miałem do czynienia z dodatkiem do VS 2012 – Razor Generator. I mówiąc szczerze – jestem bardzo pozytywnie zaskoczony. W wielkim skrócie jest to rozszerzenie umożliwiające kompilowanie plików .cshtml. W praktyce wygląda to w ten sposób, że pod widokiem znajduje się klasa o nazwie Widok.generated.cs. Przy każdej zmianie w widoku, następuje automatyczna zmiana w kodzie tej klasy, przez co nie je...
Strona głównaUżytkownik
jedmac | użytkownik
When you try to connect your Visual Studio 2008 environment to a Team Foundation Server 2010 it is so popular that you will not be able to make it. After clicking Tools->Connect to Team Foundation Server and trying to connect to your own TFS you will receive one of errors, for example this...
While working with Internet Information Services (IIS) you can meet several problems. One of the most popular issue is a communique that you can’t start W3SVC. You can find a lot of articles in which people says that you should re-install IIS. But there is another way to fix it...
Dzisiaj o czymś, z czym spotkałem się podczas niedawnego dewelopmentu. Pewnego razu klient zażyczył sobie, żeby w grupie nakładających się znaczników, klikając w przeglądarce na jeden z nich, grupa rozwijała się automatycznie i widoczne były znaczniki w postaci “ślimaka” lub “słońca”. Po przeszukaniu zasobów Internetu, natknąłem się na Overlapping Marker Spiderfier (oms.js) . Okazało się, że jest to świetne rozwiązanie, z którego oczywiście skorzystałem.
Po ponad miesiącu od ostatniego wpisu (niestety, mimo chęci, nie mogłem znaleźć chwili wolnego czasu) poruszę dzisiaj temat jednego z najczęściej używanych wzorców projektowych – Factory Method. Przy użyciu tego wzorca, możemy w prosty sposób zaimplementować funkcjonalność związaną z wytwarzaniem konkretnych “produktów” przez konkretne “fabryki”.
Sztuka programowania 4002 dni, 20 godzin, 27 minut temu 392 źrodło rozwiń
10.18.13 by MJ Short post about searching List. There are 3 most popular methods: foreach, delegate and lambda expression. I will introduce all of them. Let’s say that we have List which stores cars. Car has 2 properties – brand and model. var listOfCars = new List { new Car() { Brand = "Car1Brand", Model = "Car1Model" }, new Car() { Brand = "Car2Brand", Model = "Car2Model" }, new Car() { Brand = "Car3Brand", Model = "Car3Model"...
Sztuka programowania 4042 dni, 8 godzin, 14 minut temu 120 ź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...
Architektura 4052 dni, 55 minut temu 168 ź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...
Architektura 4052 dni, 7 godzin, 44 minuty temu 122 ź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...
Architektura 4056 dni, 20 godzin, 27 minut temu 179 źrodło rozwiń
09.26.13 by MJ Previously I wrote a post about creating a simple ASP.NET MVC 4 application. I have told you, that it is so simple. Today you will see that it can be easier with MVC scaffolding. 1. Open Visual Studio 2012 2. File/New/Project -> select Web/ASP.NET MVC 4 Web Application. Name it MvcCars. 3. When new window appears, please select a template as Internet Application and the vie engine as Razor. For this example, please do not select Create a unit test project. 4. Confirm Your...
WCF service allows you to use a huge functionality even though you have a slow local machine. Sounds good? Yes, it does. Let’s create a simple WCF service to add people. All coding is done with VS 2010 Ultimate. What you need to do first is to create a new WCF Service Library. When it is already done, please delete all default classes, which creator has added to your project automatically. Now follow these steps: 1) Prepare a simple class which will be responsible for a new ...
12.13.12 by MJ In September I wrote a short article about writing a clean code. I told you that it is a good habit to implement programs with a one and good style. Today I am going to wrtie something about a special tools which are very useful during programming. First of all, you need to have a JetBrains ReSharper installed at your local machine. Then you have to download a StyleCop, which is a plugin designed for ReSharper (http://stylecop.codeplex.com/releases/view/79972). ReSharper allows...
by MJ How many times have you heard about building a well designed web application? 3-4? I mean in your daily work. How many times have you faced a problem with code written before? Wrong naming, wrong spacing, wrong design, wrong patterns/no patterns, wrong repository, wrong database connection, wrong architecture. There are a lot of mistakes done, before you have first seen the project. Then, the most common situation is that your boss comes to you with a request, that the previous web application s...
07.27.13 by MJ My friend has asked this question one week ago. He was not able to understand the usage of interfaces in his small projects. I decided to explain it, but I knew that it would be a long journey, from the beginning to the end. FInally he got the idea. Today I will try to explain this to you, audience. “Q” is defined as a question. “A” as an answer. Q: What is interface? A: We can say that interface is a kind of class which has declarations of all methods, properties or events. I...
Sztuka programowania 4074 dni, 2 godziny, 23 minuty temu 251 źrodło rozwiń