AngularJS Custom Directives for dummies

AngularJS directives are the commands which communicate with angular library and tell angular to do a job on the HTML tags, they extends the functionalities of the HTML elements. AngularJS provides many built-in directives e.g. ng-app, ng-model, ng-repeat, ng-controller etc. Thus, ng-model is used to do data binding. AngularJS also gives us the ability of writing our own custom directives, We can extend the abilities of HTML’s template to do anything, we can imagine.

Continue reading

Posted in AngularJs | Tagged , | Leave a comment

Factory Design Pattern Real Word Example

Factory pattern is one of the most used design patterns. The Factory pattern is a design pattern used to define a runtime interface for creating an object. It’s called a factory because it creates various types of objects without necessarily knowing what kind of object it creates or how to create it.

Continue reading

Posted in Architecture | Tagged , | Leave a comment

Implementation of Repository and Unit of Work Patterns using EF

The repository pattern is closely related to data access and allows us to have an abstraction of the implementation of data access in our applications, so that our business logic does not know or is uncoupled to the data source. In a nutshell this means that the repository acts as an intermediary between our business logic and our data access logic to be centralized in a single point, and thus be able to avoid redundancy code. This abstraction of the data access allows us to decouple and test a simpler way our code, since being uncoupled we can generate unit tests more easily.

Continue reading

Posted in Architecture | Tagged , , | Leave a comment

Asp.net Cache Implementation with a Fallback Function

The power of caching in ASP.NET is exposed via the Cache object. Using the Cache object which is in the namespace System.Web.Caching, you can store any serializable data object, and control how that cache entry expires based on a combination of one or more dependencies.

Continue reading

Posted in ASP.NET | Tagged , | Leave a comment

Decorator Pattern using a Dependency Injection Container

Here we go again, this time I will show you an example about how to implement the decorator pattern using a DI container, in this case I will use Simple Injector . I have been working with this container at the office and it has worked really well, it is well documented and has a good performance.

Continue reading

Posted in Architecture | Tagged , | Leave a comment

Deserialize and Serialize a xml using DatacontractSerializer

I have finally decided to create my blog about programming and technology in general,I hope this blog will be useful for those who can read these lines.

I will begin for something simple, how we can serialize or deserialize a xml file using  DataContractSerializer. The .Net framework release 3.5  included a new serialization engine called DataContractSerializer, this class is the replacement of the old XMLSerializer.

Continue reading

Posted in .Net | Tagged , , , | Leave a comment