NBusiness 2.0 RC Feedback

Aug 2, 2007 at 3:41 PM
Hi Justin,

Your project and the approach to the business layer development it takes is very close to what I've got in my mind and I've been tracking your progress with great interest almost from the time it appeared here on CodePlex. Yesterday I downloaded the brand new 2.0 RC version and have some feedback which hopefully might be helpful for you.

On my setup, I couldn't open the example project - Visual Studio claimed that the Example.Business project type is not supported. New Visual E# projects could be created, but the same error appeared just right after the project has been created and VS tried to load it. First, I thought there is some collision with VS 2008 B2 which I also have installed on the machine, but now I'm not so sure, because everything started to work after I installed Visual Studio 2005 SDK, opened the sources and build the NBusiness.VisualStudio solution etc. I didn't try to recheck whether it started working after each of these steps so I don't know whether just installing the SDK helped, or whether the local rebuild was necessary to.

Another thing, which is an issue I encounter often in many projects (including mine :-)), is awareness of non-English culture systems. On my system the line 'validate Ounces minvalue "0.1";' returns error "Could not convert argument to the required Type". When I change the "0.1" to "0,1", it compiles fine. I suppose .es files should be culture-independent (í.e. the same e# source code should be compilable on system with any culture) so simply setting always the same culture for the thread which does E# source parsing in compiler should be adequate solution.

As for the VS integration, I've got just two small suggestions based on my experience until now. First I've had trouble with esc compiler integration, i.e. how VS handles its output. The error list does not always show what it should - e.g. when I've had that culture-based error, instead of getting the error about not being able to convert the argument, it displayed "Could not get all dependencies for project reference 'Example.Business'. For some reason this error is being displayed even though the culture-based error is gone, but it doesn't seem to be fatal error, because the solution builds successfully anyway. This is just some small glitch in the solution configuration I guess, but what is more unfriendly is what output of esc is shown in the Output tool window. It is practically unreadable (unusable), because it's weirdly formatted and missing many texts. Seems like the multiline output of esc is not very well supported by Output and Error List Tool windows' parsers.
For example this is all I get from esc when I compile the Example project (it is one line):
G:\9\Example\Business\Install.es(7,1)Warning ES0006: G:\9\Example\Business\Log.es(7,1)Warning ES0006: G:\9\Example\Business\LogLevel.es(7,1)Warning ES0006: G:\9\Example\Business\Install.es(7,1)Warning ES0008: G:\9\Example\Business\Log.es(7,1)Warning ES0008: G:\9\Example\Business\LogLevel.es(7,1)Warning ES0008: G:\9\Example\Business\LogLevel.es(7,1)Warning ES0008: Example.Business -> G:\9\Example\Business\bin\Debug\Example.Business.dll

Second suggestion for the VS integration is just a small wish. It would be great, if it was possible to see generated C# code by right clicking on the .es file and selecting something like "View generated code". I didn't look into all the internals of E# compiler and from command-line switches I can see it does not offer possibility to generate just C# sources, but this feature would be really appreciated for many reasons and using Reflector.NET is not as comfortable as being able to see what's going behind the scenes with just two clicks.

I've got to leave now for four days so I'll continue with the Getting started tutorial and the project evaluation on Monday and send more feedback if it helps. This message is already unreadably long anyway. :-) In Getting started I'm currently stuck at getting 'Update schema' menu item to display on context menu for Example.Business project tree node. I've set the Development Data Source Connection String, but the menu item didn't not appear as it supposedly should. Maybe I've got some error in the connection string, I'll investigate on Monday.

Thanks and hats off to you for all the ideas and effort you've put into the project.


PS: Do you know http://nolics.net/? It concentrates more on DAL than business layer, but like E# it uses its own domain language, and maybe in some areas it can be good inspiration for NBusiness.
Aug 3, 2007 at 3:34 PM
Thanks for the awesome feedback! I'll add some new issues so I can address these things. I was just made aware from someone else that the integration aspects weren't working quite correctly for them either. This has been the absolutely hardest part about trying to get it to work for sure. I'll try to address what I know about your various problems here.

Example.Business project type is not supported
I'm not yet sure what is up with this I suppose I have some neccessary assemblies missing from the installer. It should be able to be independant from the SDK it's quite hard to figure out what all is required. I'll figure this one out ASAP.

Could not convert argument to the required Type
This is an interesting issue that I definitely hadn't been thinking about and I'm not sure how to resolve it. I'll have to look into it more, I'd be happy to have any suggestions and/or patches.

Could not get all dependencies for project reference 'Example.Business'
This is actually a known bug in the visual studio SDK. Here is the link to a reference:

This is because I made heavy use of the Iron Python example in the SDK to get my custom project type working and suffer from the same bug. I've tried tracking it down several times but it appears that the problem is only related to websites referencing these projects so the website project itself is doing something strage that I was unable to figure out. But, like you said, it still builds and runs fine so go figure!

output of esc as shown in the Output tool window is unreadable
I'll definitely take a look at that, it looks it needs some newline characters in a bad way plus the error information is just missing straight out. I have to admit I neglected esc a bit while working on this integration package but I'll make sure it's cleaned up.

see generated C# code by right clicking on the .es file
That's a pretty good idea, I'll have to think about it some more to figure out the best way to do it though. The generated files are put into the /obj/Generated/ folder relative to your project just so you know. I wonder if it would even be a good idea to put the generated files into the project as sub items with a different icon? Like a read only file... The trick is there are usually multiple generated files for 1 entity so the question is, if there was a right click menu option which file would it go to? I'll put it in as a Feature Request.

'Update schema' menu item does not display
I have heard this feedback from someone else as well. I must be either not setting a necessary registry key in the installer or missing some sort of file that visual studio is looking for, I'll definitely figure this one out. A work around for now is to go into obj/Generated/SqlScripts/complete.sql and run that file manually. In effect the "update schema" command is simply doing that anyway.

I haven't heard of http://nolics.net before but I'll check it out. I'm guessing you're part of the development team for it? Looks like we have a few ideas in common here. Thanks again for all the feedback!
Aug 3, 2007 at 3:47 PM

Here are the related work items:
Example.Business project type is not supported
Could not convert argument to the required Type
Could not get all dependencies for project reference 'Example.Business'
output of esc as shown in the Output tool window is unreadable
'Update schema' menu item does not display
Aug 6, 2007 at 11:17 AM
I have added some comments to 'Could not convert argument to the required Type' issue. As for the 'see generated C# code by right clicking on the .es file' feature, I think putting generated files as sub items with different icon is great idea. The right click menu option should not be necessary when all the generated sources are available as sub items.

As for the nolics.net, I'm related in no way with them. I found it some time ago when browsing the web and I liked the idea. I understand NBusiness as domain specific language-based solution for building business layers, which is similar to solution chosen by authors of nolics.net for building data layers.