VS2008 Again

Topics: User Forum
Aug 2, 2008 at 3:55 PM
Hi,
I have an installation of Visual Studio 2008 with the VS SDK.  The latest source from SVN (as of Aug. 2) compiles (almost) cleanly.  However, when trying the 'experimental hive' of Visual Studio I still can't get any projects having to do with E# projects.  Am I missing something, or is support for VS2008 not ready yet?  If not, how would you suggest I proceed in order to test drive NBusiness? 

Thanks for your time and efforts!
Yuval
Coordinator
Aug 5, 2008 at 5:20 PM
Ah yes, well there is plenty left to do before it's fully ready but it should work for you in VS 2008. The plugin usability has plenty left to do that's for sure.

However a few things to note:
  • The new version doesn't have NBusiness projects! This ends up being a much simpler solution, in the older version you had NBusiness projects with C#/VB partial classes with it which totally eliminated syntax hilighting and intellisense in those code files. That was very painful now E# files can exist in any regular .net project. Try creating a console application in C# (for example) and adding a new item. In your new items list you should see an "Entity". If you don't you can just add a text file and use the .es file extension. Make sure the custom tool ESharpCodeGenerator is applied to your es file. To get the "Entity" to show up in your new items list you might have to run "devenv /rootSuffix exp /ranu /setup" from the visual studio command prompt. Getting those templates registered is sometimes a pain in the butt for the experimental hive.
  • Templates are sparse right now, that's what I have been working on. Creating templates is time consuming... but you can easily create your own. One new feature of v3 is that you can define templates in the same project that you declare your entities. Just add a reference to NBusiness.Templates then create a class that inherits from TemplateBase or CodeDomTemplatebase. Make sure you build once but then you should be able to use that template to do your code generation.
  • You can also use Spark or NVelocity to do your code generation, this is heavily under construction right now though. I have created a few "Custom Tools" that you can apply to .spark or .nv files to generate a class that inherits from TemplateBase for you. This is not very pluggable right now but if you want to use a different view engine I can help you figure out how and would be happy to accept patches for new view engines. So far Spark has been treating me pretty well... except that it only works with C# currently :( I've also been toying around with creating a XAML based view engine for generating code... it's pretty cool but might be more work that it's worth at this point.
  • The default business object framework needs lots of TLC. I've been creating templates targeting CSLA for now. I plan on having templates for both later on. Targeting new frameworks (NHibernate for example) will require a patch to allow you to detect validation rules etc. for intellisense. There is nothing stopping you from targetting them but it won't detect rules automatically (it turns out that is an incredibly hard problem).
  • Basically, most phases are in process right now. The core functionality "works" now it's just a matter of polishing up the VS integration piece and building templates and generally making the barrier to entry lower.
Aug 7, 2008 at 4:32 PM
Thanks Justin, I got the Entity item in the list.  I'll be playing with it a little this weekend to get a feel for the framework - I may have a small project next week where it might come in handy.  In that case, I'll of course produce patches for anything that's changed.
Jan 2, 2009 at 1:43 PM
Hi,

I just want to say that your project seam to me the best way to create application architecture and the E# is a superb idea between the C# and an elegant descriptive language, XML is at the stone age in comparison !

But I am only in visual studio 2008 so I can't try your projet (that's too bad ! :-( ).

Any news about the visual studio 2008 integration ? Any date ?

And do you plan an integration of Linq ?

Thanks for your great job !

Anthyme

PS : Sorry for my english, it's not my first language.
Coordinator
Jan 2, 2009 at 7:21 PM
Hello! 

Thanks for the feedback, the version in source currently works with 2008 but it isn't quite ready for use yet. I've been stumped for a while on the best way to translate E# into actual code. It turns out that most of the view engines out there (translating meta data into code) have been much too limited for my needs so I've been struggling to complete that final bridge.

However I think I finally have a solution that is well underway and working pretty well, see this blog post for the general idea http://www.justnbusiness.com/Blogs/Template_DSL_with_MGrammar.aspx. Once this evolves a little bit more I will probably make it as a separate CodePlex project and use it in NBusiness for the templating system... which also means I might end up converting the NBusiness parser into an MGrammar DSL. First things first though.

Sorry for how long this is taking, I've found that creating a DSL end-to-end turns out to be an IMMENSE amount of work. Hopefully though this will change in the future with some of the things I've been working on here.