Dependencies needeed to use only data binding in Aurelia? - data-binding

As part of the architecture team, we are currently discussing about how frontend should be developped. With the huge amount and versatility of the js framework we have decided to stick on standard as much as possible. So we have decided to use ECMA6 script with web component, fetch api for ajax and polyfills. However, we don't have any data binding for the moment. I was looking for a non intrusive framework that will do the job and found Aurelia very interesting. However, some of us are concerned by the relative heavy weight of the lib(270k+60k for system.js) while we only need data-binding. Is there a way to reduce the size of this lib ? I have noticed there is a data-binding library ? Is it possible to only use that library ? If so how ?

Related

How to target Silverlight from a portable class library that uses reflection API?

I have a portable class library that targets WSA, NET45 and WP8, and I would also like to target SL5. What's silly is that 99% of the library code is SL- compliant, but in has a couple of places where I make a call to a reflection API to retrieve type property or field:
var fields = myType.GetTypeInfo().DeclaredFields;
Unfortunately GetTypeInfo is not available in SL5, so the above code won't compile. So I basically have there options:
Don't target SL5 from the PCL, so I will need to keep a separate library for Silverlight.
Extract from PCL code that uses reflection, so PCL will need to resolve this dependency on start.
Do something smart at runtime, so PCL can detect what methods are available and call the appropriate one.
Option 1 is ok, but I'd rather find an alternative to maintaining a duplicate library.
Option 2 would be ok if I had to extract a large piece of functionality so it would be worth introducing a bootstraper. When it's a couple of lines that don't compile it's silly to drag DI/IoC.
So I am thinking about option 3 without clear understanding if it's even possible. Reflection is my friend, but it's a reflection API mismatch that I am trying to overcome.
Advises/experience sharing is appreciated.
After playing with the code it struck me that I could simple use old way of retrieving fields:
var fields = myType.GetFields(BindingFlags.Public | BindingFlags.Static);
I was under impression that because of reflection API change this syntax is not available in PCL, but it was in fact opposite: using this syntax I can target both .NET 4.0.3, .NET 4.5, .NET for WSA, WP8 and SL5.
How about this?
Reflection.Assembly = Reflection.IntrospectionExtensions.GetTypeInfo(GetType(*anyTypeInAssembly*)).Assembly

Help choose a code generation tools for ASP.NET

I am new to the code generation tools and I would like to know how does a tool like LLBGen Pro compares with the Entity Framework?
On top of that my boos is really looking into a tool called CodeOnTime http://codeontime.com/default.aspx because he likes their good UI support.
I am asking here because I really want an unbiased opinion.
I am not sure if LLBGen can also generate the UI. So far all the development in the house we do it the classic way coding each layer manually. However we are in need of a fast prototyping tool.
Any advice to help me choose wisely will be much appreciated
thanks in advance.
Have you taken a look at CodeSmith Generator? It's a template based generation tool with Visual Studio integration, so by definition all templates are open source, and it has advanced features such as generate on build that keep your project up to date with your data source at all times.
Also, the CodeSmith team is about to start working on an official set of EF templates, but for now they offer several different ORM options including LINQ to SQL, NHibernate, .netTiers, CLSA, etc.
The thing is that there are code generators and object relational mappers (ORM) and code generators that do object relational mapping.
Something like NHibernate is a pure (ORM) and doesn't generate any code, it just provides you with an object persistence layer.
Llblgen is a code generator that generates code that performs the functions of an ORM but you can actually see the code and can override it with custom behaviour. Llblgen won't generate your UI for you and it isn't designed to. It's heavily focused around data access.
Then you have tools like CodeSmith or the built in T4 generator that comes with visual studio which you can use to create templates and then they will generate anything you want, provided you write your own templates. I've worked for companies that have invested thousands into writing their own templates.
Finally there are complete tools like CodeOnTime or IronSpeed which generate entire applications for you. This sounds good in theory, and is great for small CRUD type applications, but you lose a lot of flexibility with tools like these as they often have conventions which you are required to work around and once you start getting into heavy customization, tend to get in your way.
You should ask yourself:
Do I just need something for accessing my data? if so, you could use an ORM
Do I need to generate a highly customized UI? if so, you'd probably be best avoiding the tool like CodeOnTime and IronSpeed
I've used both LLBLGen and Entity Framework. In my experience, they are roughly equal in capability, especially now that Entity Framework 4 has been released. NHibernate is also in this realm and should be considered if you're looking to compare the top ORM tools for .NET.
I would recommend downloading the LLBLGenPro demo to evaluate it. According to Frans Bouma's blog, LLBLGenPro offers enhanced features not present in the out-of-the-box Entity Framework tooling built into VS.NET 2010.
ORM tools like EF and LLBLGen do not generate UI. For that you will need something like IronSpeed (not recommended, I don't like the code generated) or the IdeaBlade DevForce products, which I have not used.

Design strategies for class libraries that span Javascript and C#

I'm implementing some objects which will have about an equal amount of richness on both the client-side and server side.
In this particular case, I'll be building a (hopefully) little class library to deal with search tokens. So as a pseudo-code example, I'll want to be able to do the equivalent of the following in both Javascript and on the server (C# in my case).
s = new SearchTokenList();
s.Add(new SearchToken(field, value, negation));
What design strategies will help avoid creating a big ball of mud for a library which must span C# and Javascript?
Update: Looking for more of strategies than mechanics. But I'll take any guidance I can get from those who have previously done similar things.
Take a look at Script# by Nikhil Kothari, might help you out. It is a C# to JavaScript compiler.
I think you should check out my C# to JavaScript compiler out at http://jsc.sourceforge.net/
Unlike Script# my jsc compiler works on MSIL level.
WPF Example: AvalonExampleGallery
Contact me if you have any specific questions.
If performance is not critical, you could load the data in JSON or XML and pass it back to server-side and do the processing. I think WCF can generate JavaScript interface out of the box. See .NET by Example: Calling a WCF service from Javascript.
You should be able to run some Javascript code on your .NET server using Microsoft's JScript.NET -- compile it with /target:library and make sure it's CLS-compliant and that you declare that fact with
[assembly:System.CLSCompliant(true)]
or other variants of CLS compliance declarations. Once you've gotten this to work, you could run (a bit of) JS code on both the server (calling it from C#) and the client (calling it from other JS) and more easily ensure equal functionality on both sides.

ASP.NET and Flash - can flash talk to .net

Can a flash front end talk to a .net backend?
Yes.
We use Adobe Flex to talk to .Net XML web services.
Be careful with complex serialised .Net types (for instance DataSets) - ActionScript can't handle them.
Instead produce simple XML with primitive types.
See also: Flex and ADO.NET Data Services...anyone done it?
<mx:WebService id="myDataService" showBusyCursor="true">
<mx:operation name="WebMethodName" resultFormat="object" result="functionFiredOnComplete();"></mx:operation>
</mx:WebService>
public function load():void
{
myDataService.loadWSDL( "web method's wsdl" );
myDataService.WebMethodName.send( params );
}
public function functionFiredOnComplete():void
{
// get data
var myData:Object = myDataService.WebMethodName.lastResult;
...
Flash can also talk to the hosting page via JavaScript.
you could also try AMF.NET, a .NET implementation of Flash Remoting using ActionScript Messaging Format (AMF)
http://amfnet.openmymind.net/overview/default.aspx
Yes
Best keywords to search for are Flash .net and Flex
In the old days there was another tool but with Flex its all been simplified.
If you are de/serializing a lot of objects (which Flash/Flex isn't particularly fast at), or more complex types, then you might want to take a look at WebOrb. It's a free object broker, which might sound scary, but it basically handles translation between the native object types of the two technologies. It pretty much "just works", and can increase performance quite significantly in some situations.
It also comes with a code generation tool if all you want is CRUD and stored procedure access for a SQL database, which is quite nice.
I would recomend FluorineFX we use that at work and its great. The only downside is that we end up with a lot of value objects that are only used to transfer data between .net and flex. And the fact that the standard C# naming style and the flex naming style has some minor differences makes value objects a bit ugly in either flex or .net.
My older brother and I developed several methods for Flash/.Net communication. I've seen web services mentioned above (which is a great way of doing it), but we also used simple .aspx pages and had stuff passed via querystring (poor man's way of doing things), using Flashvars to get data TO Flash, but my favorite - Using .Net and a repeater control to build xml files which were then consumed by Flash. We created some pretty cool stuff doing that!

ASP.NET based Workflow Engine

I am working on a design spec for a new application that will be heavily workflow driven.
Before I re-invent the wheel, is there a decent lightweight workflow engine that plugs into ASP.NET already around?
Basically, I'm looking for something that handles moving through a defined set of workflow pages while handling state management automatically.
If this isn't around already, I'll definitely try to abstract the engine from my app and put it on codeplex, as it would be really handy.
Any suggestions?
Note: .NET 2.0, so no WWF, though I think WWF is overkill for my needs.
EDIT: Seems like there is a legitimate need for this, and there isn't a product out there...So I might build this.
Here is what I'm picturing:
Custom Page class called WebFlowPage
All WebFlowPage's are registered in a Workflow mapper.
Each WebFlowPage has some form of state object.
A HttpHandler handles picking the appropriate WebFlowPage based upon the workflow, and populating it from the state object.
Is the workflow dynamic, or static?
If the workflows are simple, you could roll your own workflow engine.
In certain situations, it can be fairly simple, and just a couple of data tables to handle the rules, processing and state.
Alot of workflow engines are built for large scale processing (credit card applications, for example). For small scale, you should at least consider your own, which would eliminate the overhead and dependency of/on an engine.
Not sure exactly what you wish to do here, but Ra-Ajax can easily keep state at least if you want your solution ajaxified...
For reference purposes you might want to check out the Ajax Calendar sample or even the (banalistically implemented) Ajax Wizard sample. It surely beats the hell out of doing it with JavaScript...
And every time you "do something" you're in "server-land" which means you can store temporaries all the time as you wish...
The project is LGPL
(PS!
Yes I do work with it)
Building a custom workflow engine is not trivial, although it may seem simple at first. We've tried that. It depends a lot on the complexity of the logic you need it to cover.
Given the current state of the Windows Workflow Foundation and the lack of another framework that abstracts the workflow concepts, I would choose WF if you need complex logic, asynchronous handling or branches in your workflows.
Tracking your state through the workflow can be accomplished by carrying some kind of xml payload or storing the state in a database,
If your workflow is actually a sequential set of forms that need to be filled in by the user, tracking the steps and guiding the user to the next step can be accomplished with some simple custom solution.
You could take a look at the InRule engine too.
Also, there is nxBRE.
These too are mostly used for business rules.
InRule is proprietary, whereas nxBRE supports RuleML (the defacto standard).
You might need to make your own implementation for the pages, and use the rule engine as the "structure".
At this moment, I know that Sharepoint 2007 supports page workflows (using WF), but this would imply using .NET Framework 3 and deployng sharepoint.
My suggestion would be to use whatever you find more light and easier to use.
I think the term "workflow" is very open to interpretation. I have been working lately with a type of workflow that is very different from what you seem to be describing. Mine is a state machine based workflow where the state of a particular record determines what actions a user can take to move the record to the next step in the business process. So "workflow" in this instance means how the record flows from one state to another until it is finally completed.
Your usage of workflow seems to have more to do with moving a user from one page to another in a linear multi-step process, which is a completely different use case (correct me if I'm wrong). So before coming up with a general purpose "workflow" engine that anyone could use, I would recommend defining a little bit better exactly what types of situations this system would handle.
I've been using this for a few months http://objectflow.codeplex.com. Not asp specific but it may fit your needs
While browsing the web for some workflow & BPM resources, I found the following project: NetBPM. Unfortunately, the project seems to be stopped.
I don't think there is a workflow engine that will automatically handle state for you, but if you are moving through a set of pages like a process such as checkout on an ecommerce site, perhaps the ASP.NET wizard control could help you?
There are few workflow options. "Aspose" and "Skelta" are the offers I´m evaluating.
Fábio
you can use WorkFlow Engine, just read the document and run the Demo.
all of the features you need for a dynamic workflow engine they added in there.

Resources