3

I am learning ASP.NET MVC 4 and a basic component is the User-part. I plan to have the articles have an author, which is turn is a user. However, the standard user stuff (AccounModel/Controller/View) that comes out of the box of the MVC seems very complicated and hard to extend, so I was wondering what are its advantages, and if people actually use this?

My backup plan is to delete the whole thing, and implement my own.

kasperhj
  • 10,052
  • 21
  • 63
  • 106
  • 1
    Not really answering your question, but such in-the-box scaffolding usually serves as a starter kit for those new to framework. One doesn't have to use it, but one may learn from it. – Valentin V Nov 21 '12 at 12:13

2 Answers2

2

You can use your custom account staff (Model/Controller/View), but custom stuff should be based on shipped authorize system (AuthorizeAttribute, Roles, Account, database model schema) it will be better in many causes:

  • Usage default authorize system is more easy.

  • Default authorize system provide enouth functionality to manage roles, accounts etc.

Developing your authorize system is very complicated because the cost of fails, bugs in your own authorize components may be cause of security breaches. I would recommend developing your custom authorize components in rare cases.

testCoder
  • 7,155
  • 13
  • 56
  • 75
  • Do you have an example of how to extend the authorize system? I would like my users to have a picture, and some additional information. – kasperhj Nov 21 '12 at 12:49
  • 1
    You can add extra fields how specified here http://stackoverflow.com/questions/12435252/how-to-create-custom-additional-fields-in-userprofile-in-mvc4 – testCoder Nov 21 '12 at 12:55
1

It's just an example template... You can extend it if you want but lots of people use their own. especially when working with Entity framework and generating models and views it's easier and better fitting to use your own methodology. since if you do not, it will be an exception to what you are doing and in coding we don't like exceptions :-) .

user1841243
  • 1,663
  • 2
  • 19
  • 35