Can i trademark that term? 😛

“Abstract View Controller” instead of “Model View Controller”

Just like any teacher, sometimes they teach us so bad, so wrong

Lets use an example of MVC

Model: Person
View: Render(Person person);
Controller: Create(Person person);

Question: Is your code reuseable?
Absolutely not

thats why we have code generator, scaffolding and stuff

next…

Question 02 – How will you create data access?
yes you lazy developer, entity framework?

you will do: using DbContext.People.Add(person)

and what will you do if you have another entity? like Country
oh Tsuyoshi, ofcourse my generator will create those entity
or i can create a code first class putting it on DbContext bla2

Here i tell you what, since the introducing of LINQ you guys abusing strong typing so insanely and totally forgot about abstraction

Right at this moment, i create a web site with this AVC technique

Abstract Model
View: Render();
Controller: Create();Update();Delete();
DataAccess: Save(AbstractModel);

yes, my asp.net controller have no parameter, i am not joking
my one method data access can handle any type of entity you throw on it
and my view can render any kind of entity

Code reuseable check
No generator check
Less working check
No performance issue check

if you are curious, then ask me on comment

otherwise lets wait someone at .net team realize this
and i bet you will more believe someone from Microsoft than any random blog post from me

 

Advertisements