Rules engine for Silverlight? - silverlight

At the moment I'm developing a web based application using Silverlight 3.0. For the business rules I'm looking for a rules engine that's both easy to use for me and my users, which will work with SL3. Is something like that available out of the box or will I need to roll my own?
I've Googled and looked around the various code sites (Codeplex, Code Project etc), but didn't see anything that suits my needs.
I did also have a good long look at NxBRE, but it's Rules syntax is too complex for 'dummy' users.

What about the rules engine that comes with Windows Workflow Foundation?
http://blogs.microsoft.co.il/blogs/bursteg/archive/2007/08/09/WF-Rules-Engine-without-Workflow.aspx

For people who stumbled upon this thread looking to use NxBRE as a Rules Engine with Silverlight (SL), here is my two cents.
I tried referencing NxBRE dll in my SL project with no luck. SL does NOT allow dlls that are not built using SL CLR to be referenced in an SL project.
Fortunately NxBRE is an open source project so I downloaded the source files to build it using SL CLR.
SL does not support a lot of .NET types, namely objects in namespaces System.Xml.XPath, System.Xml.XPath etc. These are required for NxBRE to compile.
So I had NO luck using NxBRE with SL. These are my first impressions, if I find more by digging deeper I shall let you guys know.
Hope this is of help to someone out there.
Thanks
Sai Gudigundla

I've searched around a bit more, and decided that Rules Engines actually don't fulfill our requirements. We don't need rules, we want to do calculations on a property when the value of that property changes.
Thanks for your answers,
Cheers,
Frances

For those who might be interested: eventually we went for CSLA .Net for Silverlight

Back to the original rule engine question...
If you want to run the rule engine inside of Silverlight, you would need to find one that has been built to only use the limited subset of .NET that Silverlight supports. For example, Silverlight supports generic collections (List) but not untyped collections (List).
At this moment, I don't know of a .NET rule engine that has been (re-)targeted to the Silverlight CLR.
Furthermore, while there are interesting applications for client-side rule engines (for example: in the browser or on a mobile device), one should always consider whether the rule engine is more appropriately hosted on the back end. Take into consideration how frequently the rules are called, how much data is being moved around, etc.

Related

What is the downside of using Monocross for WPF and Silverlight?

I am thinking...
Is Monocross a good option to use so
we could port to the IPad if we were
forced to?
You are correct that we intend to support the platforms mentioned above, but we will support Windows Phone 7 moving forward, and have deprecated earlier versions of Windows Mobile.
Since the last post on this thread, we have added the concept of view perspectives to help with CRUD operations. View perspectives are used to enable multiple views for each of your model types, and are represented as a string passed from your controller to the view container to indicate the perspective you wish to provide the user. This makes it easier to construct and render views for CRUD, or any other, operations.
We are also currently writing a book for Wrox Press that will cover cross-platform development with MonoCross in much more detail. The book will be available in early 2012.
Scott Olson
MonoCross Project
Monocross very nicely follows the kind of pattern enforced by monotouch and monodroid, with a separate presentation layer and application code
According to MonoCross' own wiki, their intent seems to be to fully support these platforms, and windows mobile in the future.
At the time of this writing however, (monoCross 0.3.2) all CRUD related operations are either in development, or not yet started, so there is a good chance you will still run into trouble during your own application development.
The biggest hamper (in my opinion) in porting applications to monotouch, is the lack of databinding support, and monocross has most of those implemented at its current release, but not all of them.

While porting a windows application to web, is it better to stick to conventional web technologies or adoping RIA is wise?

The web based application I am working on currently is a port from a windows application. This application is very data intensive. There are scores of modules and each of these modules have number of forms (data entry screens) and reports whereas the forms have many many fields and likewise the reports.
I have been trying to identify the most suitable architecture for the presentation tier. There are many functions that are not very easily portable, for example printing (this too is very complex). For most of the others, I am planning to us "Ext JS" library which looks like capable of handling about 70% of complexity out of the box while for the remaining I would be custom coding or extending Ext JS.
Having said that (sorry for being so descriptive), I wonder, if this is an Intranet application, why not port the entire application to SilverLight? While I am good at .Net, I'm somewhat alien to SilverLight. Considering I know my target audience and that the software will be used per seat license, would it be better to ride on SilverLight or is it better to stick to conventional web (XHTML, JS, CSS, etc)? Further, I have to support multiple devices in future and considering that SilverLight plug-ins for many devices are yet not out, would it be a risk?
IMO, if you are developing a web application, then yes, develop it as an RIA.
The choice of technology is up to you. I prefer jQuery and have never used ExtJS. But I've taken a look at it, and if your aplication is a port of a windows application and has a lot of conventional UI elements like forms, input boxes, toolbars, menus, button etc, then go for ExtJS.
As for some controls that are not available in ExtJS, you can easily extend ExtJS.
Regarding .NET: ExtJS is completely server-technology agnostic, so you can develop your application in .NET and still use an ExtJS UI. In fact, I would prefer to do such an implementation.
Regarding Silverlight: I am slightly against using silverlight, primarily because it requires a plugin to be installed that is not available on all platforms. But since your application is an intranet application, your user base will be in your control. But you should make sure that any future decision regarding the workstation platform will not affect your application's working.
Cheers
Whether to use Silverlight over HTML/JS etc. in this case would depend on 2 key factors.
What are you familar with already
What type and range of devices you need to reach.
If you are already comfortable with HTML + ExtJS then that has to be huge pro in its favor.
The range of devices that Silverlight is possibly going to be available (Windows Phone 7 for example as well as Moonlight, I've even heard that there may be port for Andriod and Symbian) is growing. However its really early days for that and not all may materialise in a form useful to you.
Having said that it should be acknowledged that a UI designed for use on desktop does not work well on a small device. Hence you would need to develop some task specific UI for other devices regardless of the technology you use. This in turn means that there is no reason for you to try to stick with single technology for all devices.
I think you should look very carefully into WCF, REST and OData first. Good layering of the application into useful models using these would more easily enable the use of a variety of front-end technologies for the client.
If you are into .NET and other Microsoft tech then you should seriously consider using JQuery and ASP.NET MVC as another potential front end technology.
I think that you need to ponder the inconveniences of a solution based solely in Silverlight. Like Flash it needs a plugin to be installed in every station, so it loses some of the premises of web applications (run everywhere with the only requirement of a browser). Besides although Silverlight has taken great advances, it is not yet a widely supported standard, and it is in control of a company who later may decide for you in very important matters regarding the platform you use, and made it outdated or useless (in the worst case).
Ext JS is a great library developed entirely in Javascript, so you can touch anything that suits your needs. If the Windows applications you are basing on is well-layered, then your work may not be that hard.
If you are an asp.net developer you could take a look on asp.net mvc, a great set of tools that implements MVC pattern to web applications using the same old C# or VB. Besides the developers behind asp.net mvc, have taken a lot of work to make it suitable to work with javascript libraries like jQuery
Happy coding!!!

Why would a developer use Silverlight?

I know virtually nothing about Silverlight. I'm considering creating a browser based app and really don't know if it should be built using Silverlight or ASP.NET (which I am familiar with). I'm curious as to the reasons why a developer chooses to use Silverlight.
Thanks very much.
ASP.NET and Silverlight aren't comparable.
Silverlight is a client-side framework, comparable (perhaps) only to Adobe's Flash while ASP.NET is a server-side framework.
You use those in conjuction, not one instead of the other and they're not connected in any way.
There are a few reasons you may want to consider using Silverlight:
You have a need for great looking and
interactive web applications (that
are not Ajax, jQuery, etc.).
You want to utilize your current
programming language (VB.NET, C#,
etc) skills.
You want your "web app" to be
available out-of-the browser.
There are other reasons - have a read: Top 10 Reasons to Use Silverlight. There can be a signifcant ramp you would need to make, but once made, you may prefer SL for certain things over ASP.NET and even in some cases, not really have option available to you in ASP.NET, like, for example, perspective transforms of images that can be animated from user interactively.
If you are building something that requires lots of UI interaction, and is reasonably non-static with its presentation then i would suggest Silverlight.
If you are doing (relatively) simple UI (i.e. tabular based presentation of data like clients and orders) with not too much UI trickery then i would suggest that you stick with ASP.NET.
Having done both, i find that Silverlight kicks butt when it comes to doing complex UI stuff, or you need to eliminate callbacks and postbacks to the server.
Reuse .NET code and skill on the client browser.
Achieve high performance.
Use Silverlight if you want a flash type site without using Flash. If you want to use the .NET stack Silverlight is the way to go to do what flash can do.
Silverlight was originally known as WPF/E. It is a light version of Windows Presentation Foundation, designed for the web and embedded devices.
But yes, you can think of it as Microsoft Flash.
You could also try using web standards also, sprinkled with some Jquery and Ajax, with maybe Modernizr to use html5. What do you need to do with this exactly?
Because it's the only option for third party software development on the upcoming Windows Phone 7 platform. (OK, also XNA, but that's for games)
Oh, and they also use it on the Web for some reason.

ruby inside silverlight functionality over c#

Having just found out that you can use Ruby or Python inside a SilverLight application..
link here
..I wonder if its possible to bypass some of the SilverLight limitations with use of these languages instead of C#.
I know that the Ruby Engine inside the SilverLight application is trimmed down, just as the .NET CLR is, so I would like to know that even without all the functionality of a full Ruby or Python Engine:
Can I still be able to do something
with the use of these dynamic
languages that I wouldn't be able to do
in C# SilverLight?
.
If we need to download something built
by the community to extend the cut
down Ruby implementation (to support
Interop calls for instance?), what's
the impact on deployment?
.
If not, if you cannot do anything
you wouldn't be able to with c#, with these engines, besides
the typical benefit of a dynamic
language, and not really circumventing
some of the restrictions of the
SilverLight's CLR, why would one
choose to use Ruby in a SilverLight
application?
One of my interest points is use of sockets, socket usage in SilverLight is improving in each version, but it can still be troublesome because of the xml authorization file required on the server side..would ruby be able to make this unnecessary?
Thanks,
Ric
I suspect you won't be able to work around that. Keep in mind that it's not the language imposing the limitations here but the runtime. TO be precise, it's Silverlight itself. Since both C# and Ruby are compiled to CIL in this case you're left with more or less the exact same capabilities (except some differences in the typing system).
I'm not sure what you're getting at. Regardless of language you are still running inside the same "sandbox", security model and limited with the same cutdown libraries in Silverlight. You can extend the bits that you feel are "limited", assuming your code doesn't violate the security model, with any language.
You might be able to do things differently using another language, but the same basic constraints still apply.
You need to make sure the files are included in the xap or use the silverlight 3 slvx system to stream the assemblies defined in C# or VB etc.
The ruby language should be a complete ruby implementation so you can use all the language features ruby offers like metaprogramming etc.
All source files need to be included in the xap to work.
If you're using ruby then you get gestalt too and you can include ruby source files in the same way as you include javascript files in an html page today.
One of the best scenario for the usage of dynamic languages in .NET is to let the users extend the application with their own code, so that's the main reason I use IronPython in my Silverlight application. It's so nice to have that available in the limited .NET runtime of Silverlight. It's really easy to integrate (although I had a hard time making C# extension methods visible to Python) and it can be very powerful for the users.

Interface Architecture for Silverlight App

I'm getting ready to develop my first Silverlight app. It is going to be primarily used by my church for data input but also will need to generate at least one report, ideally in Excel but XML/XSLT is not outside the realm...
It will be Internet facing and will talk to a SQL Server 2008 db for which I will be creating a web service hosted at the ISP (db is also hosted at the ISP). The clients will be a mix of Windows and Mac.
My question specifically relates to the interface architecture. I know MVVM is big for this right now and I'm comfortable with that. I want to get this up fairly quickly (ie- next 3-4 weeks). I've also seen mention of Prism (Composite Application Guidance) and Caliburn. What are anyone's thoughts on these two? The initial version of the app is not going to be huge so I don't imagine it would be overly difficult to refactor a framework into it at a later date.
You are right, if it's your first development on SL, adding the complexity of MVVM won't help you much.
I think a good approach could be to go for something simple (e.g.: the good old Document/View could be just a good start http://msdn.microsoft.com/en-us/library/4x1xy43a(VS.80).aspx, or just breaking in standard layers, UI / BS / DL).
After that development you will have learnt a lot of good stuff, and then you will be able to throw your app and start new bigger challenges using more advanced architectures (about MVVM, a very good web cast: http://blog.lab49.com/archives/2650 it's WPF based most of the concepts can be ported to SL).
Good luck and enjoy for SL development.
Cheers
Braulio
Start with something you are very comfortable with especially if you need to get this up quickly. Follow good coding standards and should not be a problem to refactor later into other frameworks if you get a bigger team.
This is a useful pdf.
I haven't read it in detail yet myself, but this article looks rather useful:
RIA Architecture with Silverlight in mind

Resources