ASP.NET MVC and test development

I am a novice.NET programmer. I learned C #, Windows Programming, SQL Server 2005, ASP.NET 3.5. I want to ask if it will be difficult or not suitable for me to start working on a task that requires ASP.NET MVC and Test Driven Development. I already got the book "Pro ASP.NET MVC Framework", but this book overloads me. So what can I do? Please, help.

-

Thanks for your answers, everyone! Now I'm more confused :-) But I'm going to fight him to show how to study.

+4
source share
3 answers

If you do not understand MVC or TDD, and work requires experience in both areas, it is unlikely that you will get a job, however, if you are open and honest in your experience, skills and aspirations, you can ask if they have any junior positions where You can work with people in these areas so you can learn and move up.

TL version; DR =)

  • Read blogs
  • Learn TDD
  • Creating a simple MVC application
  • Extending a simple MVC application with IoC and ORM
  • Share a simple MVC application via github or similar

Full version

Learning TDD and MVC at the same time is a lot of work, since MVC is more testable than web forms, there are still many areas that are extremely difficult to verify (outbound routing is one that immediately comes to mind).

A good place to start is to take a look at some of the .NET TDD directories that are around as they will show you how an experienced TDD practitioner solves simple problems using TDD. You can also start practicing these kata to enjoy the concepts and approaches used. Take a look around the blogosphere - there are many good bloggers who write great content around MVC and TDD.

Once you overcome the initial obstacle of TDD, create a simple MVC website - something like a classic blog engine. To reduce initial cognitive load, save it simply:

  • Store everything in lists in memory and use a simple interface to hide the implementation of this from your controllers - this means that you can ignore data access for a short time.
  • Use test constructors, i.e. public MyController( IPostDao posts ) { ... } , and overload it for use at runtime with public MyController() : this( new SessionPostDao() ) {} - this means that you can ignore IoC containers for a short time.

Always remember that these β€œshortcuts” exist only to reduce the steepness of the learning curve and should never be used in production code.

Once you start creating a simple MVC application, add an IoC container to the mix. I would suggest Ninject, as it has the best documentation on common .NET IoC containers, and is also apparently the easiest to get up and running. Remember to remove these ugly overloaded constructors now that you are using IoC to create your controllers.

Next, add some real insistence, I prefer NHibernate for EF, but the NH learning curve is insanely steep (even if you use ActiveRecord). LightSpeed is a great option because the free version is limited to 8 classes of models, and it is very easy to use, but the disadvantage is that potential employers may not use it.

You now have a simple blog design using MVC, with your controllers assembled through an IoC container and your persistence processed through ORM (all of which are covered by various unit and integration tests), which you can use to show potential employers how much but you remember that this is only surface treatment, there are much more possibilities for creating MVC applications than combining several controllers, IoC and ORM (for example, routing, viewing heplers, filters, alte native viewing mechanisms ).

To make your blog with potential employers even easier, use a free github account to store your project, so you can find out git as well as mvc / tdd / ioc and orm =)

+5
source

You will have a lot to learn, but this was usually expected from junior developers. I think that if you find the opportunity to work with a team that has TDD experience and can learn from them, this is a great opportunity.

0
source

If you are still looking for a BIG task. In appearance you are above your head. If you are not sure what you can manage, I recommend getting more experience first. MVC is as big as WebForms and TDD even more.

The question is, do you want to spend 24/7 the next few months catching up?

0
source

Source: https://habr.com/ru/post/1314123/


All Articles