Archive by Author

Testing Autofac Magic

6 Jun

Kolev Says...

Using an IoC framework like Autofac is a powerful way to implement SOLID principles. From making unit testing and code organization easier, the advantages should need little or no explanation or justification.

In retrospect, the Autofac setup and functionality is great. If you usually get giddy about clean short code, it’s just magical. Autofac does a lot of the gluing for us behind the scenes which theoretically works 100% of the time but what happens when a project grows over time. Do the old registrations still work? Do new registrations step on old ones? Are there classes that match some registration they really shouldn’t?

Let’s take for example the following. It’s perfectly valid code but can make life a bit difficult.

Assuming we have an MVC application and register all classes that end on “Provider” as AsImplementedInterfaces.

That’s a reasonable thing to do so we can inject providers into our…

View original post 406 more words

Data Obfuscation in MVC

30 May

Kolev Says...

Data obfuscation or de-identification is an interesting adventure to undertake. The problem initially disguises itself as being simple: “Give me data that is just as good as my production data; however, I don’t want anyone reverse the process or figure out what the original data was.” The simplest and perhaps a naive solution would be to just replace everything with a random set of characters. The data would certainly be obfuscated but would not be very useful.

As we begin the process, things like current application logic, industry legislation and standards, uniqueness of the data can be used to our advantage or works against us. The way data is used or travels through the application until it is shown to the user have considerable implementations to consider.

To illustrate the possible complexity, here are some examples:

  • No data-tier to the data source: An application that has no centralized data-tier…

View original post 626 more words