RoR vs .NET

Ruby on Rails supports a concept of plugins and gems Similarly .NET supports private assemblies and shared assemblies.

RoR          .NET
===          ============
Plugin        Private Assembly
Gem          Shared Assembly
yaml files    resource files (For localization and globalization)

A rails plugin is a  a ready made functionality that can be easily integrated into any rails application.A plugin exists in the rails application folder. Suppose if you want to implement the same functionality in another application we need to copy the plugin into this application. No different versions of plugins exist within the same folder. If there is another version of the plugin available then we have to replace the existing version of the plugin.

Same as plugin a Private Assembly is also a piece of ready made functionality exist within the application folder. No different versions of the private assemblies exist within the same folder.


A gem is a ready made functionality that is available to the all rails applications available in the machine. Different versions of the gems can exist within the same folder.

Shared Assembly is a piece of ready made functionality that can be available to the all .NET applications within the system. So that we can use the all available functions within the shared assembly in our .NET application. Shared assemblies lies in the global assembly cache (GAC). Different versions of assemblies can exist within the GAC.


Validations

We can perform the server side validations very easily in both the technologies. In RoR there are some predefined methods are available in the ActiveRecord module itself. using these methods we can easily validate the form fields.


In .NET there are 6 types of validation controls are available. Using these controls we can validate the form fields at the server side. These are the controls we can simply place these controls on the form and associate the control attributes to the corresponding form fields.

The following are the validation controls available in both the technologies


.NET


1) Required Field Validator: Checks for the required field validation
2) Compare Validator: It checks for the datatype check and value checks
3) Regular Expression Validator: Validates the given value with the regular expression
4) Range Validator: Checks for the given value is in the specified range
5) Custom Validator: Allows us to write our own validations
6) Validation Summary: It displays all the error messages in one place


RoR

1) validates_presence_of: Checks for required field
2) validates_uniqueness_of: Checks for  uniqueness
3) validates_numericality_of: Checks for the numeric field
4) validates_size_of/validates_length_of: Both are the aliase methods checks the length of the field
5) validates_format_of: Checks for the value against the given regular expression
6) validates_confirmation_of: Checks with the confirmation fields like confirm password, confirm email...etc
7) valiades_inclusion_of: Checks the given value is in the specified list/not
8) validates_acceptence_of: Checks for whether the given terms/conditions accepted/not
9) validate: This method is used to write our own custom validations
and some more are available


Any comments/suggestions/feedbacks are appreciate...!!!!!

No comments:

Post a Comment