While my solution compiles, 80 projects, I started working on ASP.NET MVC CodeTemplates for Spark View Engine. They are available in my GitHub repo. Feel free to fork and extend!
http://github.com/detroitpro/spark/tree/master/src/CodeTemplates/
Related posts:
Finding talented developers is always a challenge and in the current economic climate many developers are holding off moving to a new position. As such, contract houses are submitting any available candidates for every position. This practice is not only another reason to avoid contracting shops but is rather taxing on the company looking to fill a position.
The man hours spent screening a single applicant can quickly balloon over 8 man hours. My current client recently felt this pain and decided to require the consulting houses to have their candidates fill out a questionnaire. In an environment with many different technologies and developer background experiences coming up with a questionnaire that covers technical, theoretical as well as passion is a daunting task.
Below is one of the recent questionnaires I filled out that I thought balanced technical and theoretical questions well. Some of the details have been redacted. And oh’ Be warned, I have no idea if these answers are correct
What is reflection?
reflection is a way you can interrogate (inspect and/or invoke) objects in a running application.
How do you inherit from a class in C#? (give a code sample)
public class GreatClass:Baseclass {}
When you inherit a protected class-level variable, who is it available to?
The derived class and of course the base class.
Describe each accessibility modifier (public, private, etc).
Public: can be accessed by anyone
Private: can only be accessed from inside the base class
Protected: can be accessed by derived and base class
Internal: like public by also must be in the same assembly
Protected Internal: like private by also must be in the same assembly
How is method overriding different from overloading?
overriding changes the functionality of a base method, overloading creates another method with different inputs/attributes (post in MVC)
What does the keyword virtual mean in the method definition?
virtual methods are methods that the derived class must override.
How can you overload a method?
By changing the type or number of parameters.
What’s the difference between an interface and abstract class?
An abstract class is something that I don’t often use. Really; C# does not support multiple inheritance so we often use interfaces to define our entities and hierarchies. In c# we can inherit from one abstract class and implement multiple interfaces.
What is the default accessibility for a class?
Private
Can you implement multiple interfaces?
Yes
What is a delegate?
The C# version of AddressOf
Code a short and simple delegate example. Code the same sample with a lambda expression.
1: public delegate int myCalc(int x, int y);
2:
3: public class doMath {
4: public string Add(int x, int y){ Console.Wr...etc }
5: public string Sub(int x, int y){ Console.Wr...etc }
6: }
7:
8: public static void Main(){
9: myCalc adder = new myCalc(doMath.Add);
10: adder(1,1);
11: }
12:
13: public static void Main(){
14: myCalc adder = (doMath.Add);
15: adder(1,1);
16: }
17:
18:
Strings are immutable, what does this mean?
The contents will not change once created, methods like toLower will not effect the string, only the output.
Code an enumeration for a status where options are: Queued, In Process, Finished
enum Status { Queued, In Process, Finished };
Can C# have multiple catch blocks?
Sure
What are design patterns?
Examples of how people smarter then me make my job easier.
Describe two design patterns you have used in a project.
Singleton! – Really; it’s was a good use…for a WCF Service to cache database results and serve those results to all web clients.
I’m not sure if MVC counts but It what I miss right now…MVVM is fine for large SL projects and the Flex stuff I am doing…well…as some of the Headspring guys on twitter might now, I’m not happy with it.
What are the most important aspects of an effective software development team?
Communication, planning, direction, understanding the problem domain (++DDD)
What is your experience with test-driven development? What are its limitations? What are its strengths?
I’m a fan and I use it where I’ve been able to convince a project manager that it fits into a project plan. When I have to take over a project without unit tests I feel lost. TDD, like design patterns, are something I love that makes my job easier.
What is your experience with Extreme Programming? What are its limitations? What are its strengths?
Not enough; the last 3 years I’ve been stuck in a big-design-up-front, not even waterfall, we spent a year on documents. 5 people, 1 year. sick. I was in a XP environment in 2001-2003.
Will this code compile? What will be its output?
Sample code was provided.
Write the PRECISE output of this code as it would appear in the console.
Sample code was provided
No related posts.
ASP.NET MVC 2 supports Spark!
What? hear me out. The release of ASP.NET MVC 2 includes an amazing hidden gem. You see the “Add View/Controller” dialog now takes into account a T4 directive “output extension”.
To get started with Custom CodeTemplates check out this excellent article by K. Scott Allen
Related posts:
ASP.NET MVC 2 was RTM’ed today and with the help of Jay Harris – @jayharris we upgraded our rather large codebase to not only ASP.NET MVC 2 RTM but also a new drop of the Spark View Engine built against the RTM.
Since the release of Spark View Engine 1.1 RC a few weeks ago there have been some minor bugs/enhancements identified but no blockers. The update to RTM was nothing more then changing the assembly reference, build number and running the build script.
These changes are not yet reflected in on the GitHub source. I’m sure there will be a pull request or Lou – @loudej will update master pretty quickly.
Head over to CodePlex to download the new release and of course thanks to Lou for building an amazing tool.
Related posts:
try:
If you annotate your methods with the WebGet annotation, when a client adds your service as a service ref, there will be no client configuration information.
catch:
To put that another way, if you use the WebGet annotation it’s assumed the calling party is going to use rest.
finally:
if you use the WebGet annotation on your WCF operations they can be called as soap operations
No related posts.
I spent the evening updating the spark source to support ASP.NET MVC RC/RC2. Well, actually I simply applied the changes that were posted to either the mailing list or codeplex.
All the tests pass:
Download it here:
Binaries: Spark-1.0.1.0-release.zip
Source: Spark-1.0.1.0-source.zip
This post, hopefully, won’t be up long.
Related posts:
Ok, that might be going a little too far but it sounds like the barrier I wrote about a few weeks ago might be going away.
Earlier this evening Phil Haack posted this tweet:
Excited to hear this I asked a leading implementation question about honoring the output extension directive in T4 templates.
Us old-timer remember the almost year before ASP.NET MVC 1.0, when we had not tooling support inside visual studio. Right before 1.0 was released we got right-click view/controller support and it made a world of difference. I honestly believe that without the GUI integration, that pushed us to use strong-typed views, MVC would have taken longer to get into less progressive shops.
I’m really excited about MVC2 …but it still needs a logo.
Related posts:
Disclaimer: This post is my personal reflection of a current situation. It’s not intended for any other use. Don’t use this information in anyway.
The previous enterprise-grade SOA architected systems I’ve worked on, last decade, were Classic ASP, Java or Webforms. These systems had their presentation layer wired directly into the services. The largest, .NET or other, MVC application I worked with was huge MVC but it had a “traditional” connection to the database.
No related posts.
I could, and will soon, write a long ass post about how I cobbled together a messed-up architecture for building Silverlight applications on top of an enterprise class SOA architecture without RIA but with RIA…
Here is a branch of AutoMapper, compiled against Silverlight and now with support for entities generated from WCF service references.
http://github.com/detroitpro/AutoMapper.Silverlight
I really hope I published it to GitHub correctly; yell at me if not.
Related posts:
This feature is small, hell since I’ve been using spark I almost forgot about it, that is until I started working on a simple administration section. The application has enough entities that “Right Click –> Crud” would make just the right tool.
ASP.NET MVC provides customizable code templates for the view/controller content. There are a few really good articles on how to get started.
ASP.NET MVC uses a custom tool to process the T4 templates.
MvcTextTemplateHost
It ignores the output extension directive in T4 templates.
(Click play)
MvcTextTemplateHost is included in Microsoft.VisualStudio.Web.Extensions.dll and this DLL that is not “part” of MVC code that was open sourced.
I’d love to write a Visual Studio addin to create spark views but I just don’t have the time. However; I do wonder if I can just have spark parse the .aspx and .ascx files.
No related posts.