Choose/Avoid Symfony Forms - symfony1

I am using Symfony.
I am exploring Symfony Forms and exploring its benifit and drawback.
I guess the main use of using these forms is the validation part.
But I need to change the html provided to me as per syntax of symfony.
Can anyone suggest me drawbacks of using them considering I wont upgrade from symfony1.4 to symfony2.0 in near future.
Some points I can think of are:
We are not able to integrate new html changes.
changes in html need to be done

Related

Implementation of CRUD with Grails framework

I've been searching all day for an answer to my problem, and don't seem to be able to find an answer.
I'm trying to implement a CRUD web application using Grails, with the IntelliIDEA IDE. Whereas with JSF i could use primefaces which allowed me to do this with general ease, i am disappointed to see, or at least seems to be that way, that the framework is a step backwards when it comes to development of html pages.
All i want is to have a table that is populated from data that is coming from a controller, and whenever i add a record it is also displayed in this table. I want to be able to edit any record on this table and also remove records. It would be awesome if there could be a component like primefaces datatables that allows me to do this easily, without having to use JavaScript. I've taken a look to the Dojo plugin, but it's so outdated and incomprehensible to me that i have discarded this option, mainly because there is no documentation on the site on how to use it with Grails, specifically.
Also, i do not want to use scaffolding. I am trying to learn how to do this from scratch, and it is of my understanding that it doesn't work too well with domains with many to many relationship, for example.
In a nutshell, what I am looking for is the best way to make a CRUD application on Grails that doesn't involve the use of scaffolding.
I would suggest you to go through "Grails in Action" book and follow the creation of web application "Quote of the Day" and "Hubbub", don't use scaffolding instead create your own views and controller using documentation provided.
This will help you to understand basic CRUD operations in Grails.
And also looking into documentation http://grails.github.io/grails-doc/latest/guide/theWebLayer.html
See if this can help you.
You are aware that the scaffolding also can generate code for you to learn from and continue your work from there (i.e. it doesn't have to happen magically behind the curtains). I would say that is the typical means of starting out with Grails and CRUD.
Otherwise, no Dojo probably won't help you out a lot. Maybe have a look at some other plugin, for instance the Easygrid plugin? It is based on Javascript though, which most solutions do.
The "Grails in Action" recommendation is probably your best bet for the long-term, learning it from the pro's rather than learning-by-doing/top-to-bottom CRUD-style.

Angular with .NET WebAPI validation, and single-point-of-truth

Is there an approach that preserves the single-definition of validation, allows immediate client-side validation, and still provides the strength of server-side validation?
I'm familiar with the following two approaches:
ngval (https://github.com/alisabzevari/ngval)
http://www.danielroot.info/2013/09/hooking-angularjs-validation-to-aspnet.html
The first renders ng-validation syntax in Razor output, based on rules stated in the model. That seems like it couples me too tightly to building Razor views, when Razor views often won't intuitively pair with a well-organized Angular app. I could use this approach, but it seems it's more a result of someone wanting to replicate "Unobtrusive jQuery/MVC Validation", than building something well-suited to Angular.
The second approach just returns server-side validation back to Angular to render. It also doesn't do a thorough job of it. If needed I could run without client-side validation, since a single-page app still won't get screen flashes... but it's not ideal.
For example, maybe there is a toolset to more directly reflect the validation rules directly on WebAPIs and consume them in an Angular app. Or another approach that I haven't found?
At https://www.youtube.com/watch?v=lHbWRFpbma4#t=1336 , the presenter seems to imply this problem is already well-solved for Angular, and refers to specification (DDD Using Specification pattern for Validation). If you are aware of any tools that make this applicable to my problem, I'd love to hear it.
p.s. It seems like this is almost certainly an often-asked question. I'm sorry I was unable to find an answer here before posting
p.p.s. I'm currently planning to use Entity Framework, but I'd switch to address this. Heck, I'd consider switching to a whole different platform for this, my first Angular-focused project.
The approach I recommend is based on #Esteban Felix commented and I used similar strategy in Java/Bean Validation and JSON schema generator.
Annotate your Domain model using Validate Model Data Using DataAnnotations
Generate schema using JSON.net other useful links
Create a AutoValidate directive that goes on and decorate fields with AngularJS build in directives for form validation e.g. ngPattern and simple things like min/max. In my case I created a mapping from Java world to AngularJS directives and wherever I needed we created custom directives.

ASP.Net MVC or HTML5 only client

I recently developed an application using HTML5 and KendoUI suite and I found it much quicker to develop than using MVC or ASP.Net.
Since HTML5 is getting so much support from vendors and with tools and platforms like PhoneGap and Windows 8 apps I was wondering what arguments will be made to rather choose MVC over a HTML5 client?
I am just trying to get some constructive motivations for and against going HTML5 client only and not making use of ASP.Net MVC or any other Server side technology to generate client HTML.
There are hugely complex things you would never be able to do without some type of server side data processing, unless your app is just trivial. Given the choice I would never go back to ASP.Net, but MVC4, Razor, EF5, Kendo and HTML5 are like greased lightning. You have the choice of emphasis on a case-by-case basis to choose where it is most appropriate to solve a particular problem in this ecosystem. You can still lean very client-side if you wish. Properly architected things have their place though and I find the MVC model gives me almost any flexibility I need. I don’t really consider MVC to be generating my HTML client code per say, but to be a facilitator, which makes me curious if your prior MVC projects may have tainted you with too much server-side reliance. But ultimately we should be crafting the solution from the problem, not trying to solve every problem with the same solution, so your query could be completely on the money. (I believe I have said nothing.)

jQuery validation plugin with MVC

We've been working with ASP.Net MVC2 based web app. We're using DataAnnotations for model validation and we've also implemented some of our own validation attributes. All is working good and the user gets the error summary (if any) after postback. Now, we plan to migrate to MVC3 in near future but meanwhile, we want to make the most out of jQuery & AJAX based validations.
Note that we've not been using any MS libraries for AJAX or validation available with MVC prjects. Our approach is to keep things as simple & clean as possible so we've been using pure jQuery based plugins. We want to enable client-side validation & remote validation using jQuery for which I believe jquery-plugin-validation is one of the best alternatives. It also supports remote validations.
Example:
http://weblogs.asp.net/cibrax/archive/2008/08/01/combining-jquery-validation-with-asp-net-mvc.aspx
Automation:
APPROACH #1: Here it is mentioned that using "MicrosoftMvcJQueryValidation.js"will automate these validations - any comments?
APPROACH #: Here's another approach which seems to provide even more automation using jQuery DataAnnotations - any comments?
If I'm on the right track kindly based on your experience let me know which approach is better.
Further, is it true that this approach will help us migrate the validations easily as we migrate to MVC3.
Example:
http://develoq.net/2011/asp-net-mvc-3-remote-validation-with-jquery/
Any better suggestions are welcome. Thank you.
PS: In any case we'll persist the model level validations.
In MVC3 you are able to rely solely on the jquery.validate.js library for validation (which is included by default), you do not need any ms specific libraries anymore (like MicrosoftMvcJQueryValidation.js or others, you CAN use them however).
Here is a simple blog post explaining how to use it, even going a step further and doing it unobtrusive:
http://geekswithblogs.net/stun/archive/2011/01/28/aspnet-mvc-3-client-side-validation-summary-with-jquery-validation-unobtrusive-javascript.aspx
On a second note:
The ASP.NET MVC 4 Beta was released a couple of days ago with a "go live" license, if you have not started to migrate I would recommend you to consider using MVC4 instead. It runs side by side with MVC 3, so you wont break anything by installing.
You can find the release notes here:
http://www.asp.net/whitepapers/mvc4-release-notes
And download it here:
http://www.asp.net/mvc/mvc4
I strongly suggest that you wait until you migrate to a newer version. Anything you write in regards to validation will have to be rewritten for MVC3/4, so why waste the effort? I'd suggest that you invest your effort into upgrading and utilize the unobtrusive validation in MVC3 (or 4 as ntziolis suggests).

form tag - is it required on ajax sites?

i recently was working on an ASP.NET MVC site that basically serves static html and uses ajax gets to return data to the page when inputs are changed. there is actually no posting or getting from an html input tag on the pages at all. (it is a specific style of site that is not used by the general public, so having compatibility problems for people without javascript is not an issue)
after designing the site, i realised that i hadn't even included any form tags. as the site does not use any direct posts or gets, and apart from it being just good html design, i wondered, in my particular situation, if there was any point to having any form tags on the page?
As ASP.NET MVC tries to differ from Web Forms, to introduce a new approach in designing web applications. They do not require forms. In fact i think it's better not to be used for navigation, submitting data, etc. Otherwise, there is no use of the MVC pattern if you still do it "the good old ASP.NET" way.
Of course ... I'm sure there are good reason forms to be used in proper places, but not as a general concept in your design.
You can read here: http://msdn.microsoft.com/en-us/magazine/cc337884.aspx how MVC was introduced in the beginning. "ASP.NET MVC - Building Web Apps without Web Forms" by Chris Tavares
Retaining a form is useful if you need your application to degrade gracefully if JavaScript is disabled or the likes. Also, jQuery and Prototype have nice Ajax helpers for serializing inputs using a form, which is really nice when you have multiple sets of data that could be submitted to different ajax endpoints from one page.
So I guess the answer to my question is no.

Resources