I've recently implemented a simple dynamic forms engine that uses dynamically loaded ASP.NET controls in concert with an EAV schema to handle the variable nature of the data model. The business was sufficiently satisfied with the end product for a time, but is now clamoring for much more complex dynamic forms:
Field visibility is tied to the values of other form fields
List of drop down possible values tied to the state of other form fields
Enforcement of various business rules across the form: i.e. Value of FieldA must be no greater than FieldX + 30 days, assuming FieldX is not null, blah blah
Other complex inter-field dependencies and business rules
As you might imagine, I'm looking for an off the shelf solution since rolling such an engine from scratch seems tedious, time consuming and not really part of our core business. Ideally, I want complete ASP.NET framework (MVC or WebForms) that encompasses all layers (Business Logic, Presentation Layer and Persistence). Beggars can't be choosers, however, so I'd make do with a framework that only dealt with Business Rule definition and evaluation. Furthermore, I'm looking for a strictly server-side solution since my hands are tied by a strict policy that disallows any dependence on client side plug-ins.
XForms seems like a perfect fit, but the only mature implementations I've found are based on Java (Orbeon) or Django (Chiba). The other XForms implementations I've found have some kind of dependence on client-side plug-ins.
I'm open to using Orbeon if I can figure out a way to integrate it with an ASP.NET application, but I've see no actual examples of such a hybrid implementation.
I looked briefly at Microsoft Office InfoPath, but it doesn't seem nearly robust enough to handle the kind of complex scenarios I need to implement.
All ideas welcome!
You should have a look at betterform (http://betterform.de) too. It's a successor of Chiba and has many improvements in comparison to the original Chiba. It is open source and hosted at sourceforge as the original product.
Related
We are building a Form Builder (why reinvent the wheel and not use an existing one is not a discussion I want to have) for my company. Development is going well and I believe we have the right strategy for making it flexible enough and robust enough.
However, the problem lies in expectations. As project leader, it is my job to make sure expectations align with deliverable functionality, in fact project success depends on it, but I am having trouble defining what the form builder should be used for. I am concerned top management thinks of it as a one-size-fits-all solution, something I disagree with. I believe there are use cases for Form Builders and then there are use cases for explicit implementations, not all data should be stored in a dynamic form builder.
My question is: Is there a rule of thumb for determining what type of data should be implemented in a dynamic Form Builder and what should not? Or maybe not one but a set of rules.
For example, a purchase request might be a good fit for the form builder, but employee registration and attendance to company training sessions might not be since you'll most likely want to have that data readily available for querying and statistics.
Which types of forms should be implemented using dynamic form builders and which should have explicit static implementations in the database?
For my experience Forms builders are useful for specific cases. When you want to create interfaces for experience users to facilitate the management of data. When designing applications that are concern about the user’s experience, the form builders are all most the times not useful.
I recently worked at HP doing several ASP.NET MVC3 projects as I came from a software background I was relatively new to the inner workings of MVC3 as well as the best practices.
During this time I somewhat adapted the coding style of fellow co-workers and ways of designing my pages that I still stick with to this day. With all of this in mind my main question is what would anyone recommend for learning material; books/videos/tutorials. I can learn from any of those resources and I would love to know that I am coding properly.
I have several projects under my belt and many large scale business solutions that I have coded using Razor and ASP.NET but there are times where I feel that what I am doing is either very hacky or just an inefficient way of coding things. The larger the project is the more difficult it becomes to add new features because of this.
I think this is my lack of experience in coding but at the same time I would like to overcome this and I feel that with the mass experience I do have with MVC3 I could adapt to a easier style or design pattern that would help me not only optimize my code but become a much better web developer. If anyone has any suggestions on books or training sites or anything please let me know as I would love to get better.
Thanks in advance to anyone that has been in my shoes and is willing or capable of recommending anything!
I was dealing with the same issue and found it useful to make a mind map. While it's impossible to give you a full understanding, I can try point you in the right direction with some basic ideas.
download/view (http://www.xmind.net/share/highroad/mvc3-design-pattern/)
Are you familiar with design patterns? Well they exists with MVC applications too :)
If you want to talk the talk and understand what people including myself are talking about, you would need to know the typical design patterns that come with building what they call enterprise level applications. These design patterns are the only real way to begin to understand the concepts.
These patterns structure complex business logic in ways that have become the tried and tested solutions (design patterns) to the design challenges the developer's face.
In the diagram notice there are 3 main layers:
Presentation Layer
Business Logic Layer
Data Access Layer
Some of the highly used design patterns when dealing with Model View Controller in ASP.NET include:
Business Logic Layer Design Patterns:
Active Record. Models relate exactly to the database like in lightweight frameworks e.g. Ruby on Rails). When creating new MVC3 application with ASP.NET and scaffolding views and controllers, this is how it sets it up. Is perfect for less complex applications. So why not just use Ruby on Rails? I would
Domain Logic Layer. Uses MVC with the controller containing very little code and create lots of extra models that can do complex logic, the MVC is only for presentation. Often with this style of layer, a lightweight layer called a Service Layer can be used to call all the functions in the Domain Layer from the controllers i.e. the controller calls the method in the Service Layer class which calls the domain layer. This design pattern seems to be very popular with people who enjoy object oriented programming. See link below to my (quite basic) project designed using Domain layer.
Transaction Script - Use the controller to do a lot of the logic work per action, the problem is a lot of actions need to do the same things so there will be code repetition
For the Data Access Layer:
Something like entity framework models combined with a repository which can perform any SQL queries you need.
Not going into all the patterns for this layer but they include: Data Mapper
With simple apps, there is no real data access layer, it only becomes necessary if you use the Domain Layer in the business layer (which usually is the case)
Depending on what structure your application takes, your Models will mean very different things. In general they will not be models linked to the database (the default when creating a new app makes them like this). Instead they will be ViewModels which are only responsible for holding data that each of the views will need.
I have created a ssample app which you can see here.
https://github.com/testbrian/enterpriseframeworksB
I don't know if this is an example of an enterprise solution, but I have learned a lot from the techniques found in RaccoonBlog. I like how the Layout.cshtml and other razor files use RenderAction to modularize the views.
The project is an example of MVC3 using RavenDb, but it's also one of the best real world applications I've seen since it's actually used in production.
Hope this helps.
From last few days i have been searching the optimal architecture for my new web application, which would be devloped in ASP.Net using C#. Until now, i only find and study following 3
Three Tier Architecture (Note: By
Tier i mean logical layer)
Model View Controller (MVC)
Model View Presenter (MVP)
Now folling are my questions:
1) As far as i understand 3 Tier Architecture and MVP can I say that MVP and 3 Tier are
the same thing? If not, then what is the difference bewtween both? (Note: I only find
the difference between MVC and MVP or MVC and 3 Tier Archi but no one adress the diff
between MVP and 3 Tier Archi)
2) I only discover above three architectural options, is there any other options
available too? (Note: Here i want only the options for overall architecture of web
application,like above 3)
From a software architecture perspective; we use terms because terms mean something. When you use a term like "3-tier", you should use it where it fits it's intended and understood meaning. All sorts of things could be deemed "3-tier" simply by virtue of having three discrete components of some sort. But, if you used that term to describe MVP, you'd be misleading the other person. Why not simply say "MVP"?
3-Tier generally refers to three physical tiers. And Wikipedia has a great article on it here.
With the associated diagram:
Neither MVP nor MVC exclude using these three physical tiers. In fact, simply coining your application as an "MVC" application (or "MVP") doesn't really clarify much anymore. For example, it could be MVC on the server side (as in ASP.NET MVC) or it could be MVC on the client side with Javascript, or both!
As far as your question about architectural options; the playing field is pretty wide-open. The choices you make typically depend on a number of factors which you should be collecting while you collect your application requirements.
Often times you must make a trade off between Scalability and Complexity. However, a number of new technologies are making this trade off negligible - and I'd advise anyone starting a new project to consider them seriously (some discussed below).
It's almost always best to have, physically, a dedicated data tier (SQL, Mongo, Azure, Amazon, take your pick), and a dedicated, scalable, logic tier (usually implemented these days as WCF services in .NET land).
Most times people join their website and logic tiers... but this doesn't have to be the case. Sometimes it makes sense to have a physical tier exclusively for web services which are only accessible by your web site tier. Again, it's all situation-dependent.
As far as logical layers go (within your logic tier) it's almost always best to have some sort of data access layer (DAL), an in-code model (whether implemented manually, or through something like LINQ-to-Entities), and a dedicated business logic layer.
More and more these days people seem to be falling back to classic HTML and Javascript (with the help of things like JQuery, Prototype, DOJO, etc.) and using REST/JSON to chat with web services for retrieving and displaying data on the client side. In this scenario you can have a full-blown application on the client side, and another full-blown application in your back end... each with their own implementations of the logical layers I described above.
Options are wide open.
My take on things:
3-tier is not the same as MVP/MVC.
Many folks interpret the "Model" as a very broad concept that could contain lots of behaviour (including domain logic). I don't. The model is what the view needs to render itself. Sometimes it may have behaviour but, once again, only for behaviour related to view rendering.
With MVP you have a 1-1 mapping between the View and the Presenter. Although conceptually you could have more in reality it probably won't turn out that way. The presenter is only concerned with mediating between other layers and the view.
With MVC there is in all probablity more than 1 view that the controller deals with since it is concerned with flow.
So MVC/MVP can be used together and are front-end related and are part of the n-tier architecture.
Hope that makes sense.
You will see in answers such as this What are MVP and MVC and what is the difference? That MVC and MVP are addressing the structure of the code concerned with UI. They address questions such as:
Which component understands the user's actions?
Which component decides what view to present next?
What is the relationship between View and Model?
Neither MVC nor MVP go into details of what's inside (or beneath) the Model. In some systems the Model is comparatively simple, just a thin skin on top of a database, in other systems there's an awful lot of logic down there, for example integration with Enterprise systems such as SAP and CICs.
In its traditional meaning a 3-tier architecture (or more generally an n-tier architecture) puts additional structure inside the Model.
This wikipedia article discusses MVC v n-tier architectures. I think it's reasonable to substitute MVP for MVC in this article.
As to your application's architecture: my perception is that modern apps tend to have a rich UI presented in the browser, using simple REST services supplied by a Model on some server and then some arbitrarily complex stuff in the model. I guess you can see this as an n-tier architecture. The interesting thing is that as you structure your Javascript (JQuery, Dojo or whatever) in teh browser you find design patterns coming out, and an MVC pattern actually can emerge purely in the presentation tier.
The DevExpress XAF does much basis work for you, it creates a database based on your business objects, and dynamically generates a UI based on these, with basic functions like add, delete, sort etc. already present.
This leaves me wondering how to go about properly designing and modelling an application built on this framework. I could only model my business objects, or I could identify functions provided by the framework and include them in a details model down to sequence diagram level, but so much is being done by 'external' calls that I feel I would be wasting valuable time.
I am hoping someone with experience modelling application designs for this specific framework can give me some advice on what areas I should focus on.
As for DC, as Leon mentioned above, it has many benefits compared to the regular persistent classes. If all goes according to plan, we will release the Domain Components technology in the near future, and resolve all the remaining issues with it.
If you feel that it is hard to learn, please let us know the most difficult parts you experienced. We will be glad to review them and possibly make the things easier for you and other users.
P.S.
I apologize for the delay in responding; I was on sick leave. You will receive more timely responses if you post your questions in the DevExpress Support Center.
#ProfK:
Am I correct that you are looking for something like visual designer for your business models?
If so, then I am afraid that XPO (XAF) does not currently provide such a functionality. However, you can use free third-party tools for modeling, such as Liekhus ADO.NET Entity Data Model XAF Extensions
I hope you find this information helpful.
I'm using XAF for almost two years now and I'm very happy with it. Developing an app is very quick, nice architecture, both Win and Web the same time and great UI. As with all frameworks, it has a learning curve, but if your already familiar with DevExpress controls that it's not very hard.
As Dennis mentioned, most behaviour can be overriden or extended. Regarding your modelling question, if think an important choice you have to make is whether or not you will use their Domain Components technology. Basically they have 2 ways: the old fashion way by inheriting from the XAF or XPO base classes or by using DC. DC allows a clean separation in modules and allows multiple inheritance. They can do that by generating classes runtime, but it still has some issues.
And the framework comes with a Business Class Library, a set of common classes which may be useful.
When I get stuck or cannot find the answer myself, I always use their fantastic Support Center. Most issues I ran into were already asked and answer on that site.
Briefly, each XAF application consists of Modules. There can be standard (system) and extra (user-defined) modules. Each Module can contain business objects, so-called Application Model customizations, Editors, Controllers, and Actions to provide additional business logic, customize UI and provide interaction between framework parts. You can model and customize your application on each level listed above, including but not limited by the underlying framework's metadata and data store ones. You can find more information about the framework's architecture here:
http://documentation.devexpress.com/#Xaf/CustomDocument2559
I should emphasize that it is possible to override behavior of almost every part of the framework. For instance, create your own editors for detail and list forms, override certain standard controllers, etc.
If you experience any further difficulties with our framework, feel free to contact us through our Support Center. We will be always glad to not only answer you questions, but advice a certain technical or design solution, provide some example code, etc.
Currently we are working on ASP .net application and i would prefer to go ahead with MVP pattern (for UI) due to several advantage it provides,
But the con of going ahead with that approach is too much of hand coding which will eat up time.
I already identified that it is possible to generate DAL with any template or by using LINQ to SQL but the only issue is with generating interface which should be implemented by usercontrol (view) and some boilerplate code (for data binding)
Now the question is
1) Is it possible to use codesmith template to get the MVP pattern (To generate interface & properties at UI layer as well as data binding)
2) It is not advisable to go ahead with MVP pattern and use the simple approach provided by codesmith template generator or any other tool
Note : I have also considered to go ahead with ASP .Net MVC but due to lack of knowledge (learning requirement) and project time line we have to drop that idea.
EDIT : In terms of man month effort it is of around 35-40 man month's effort to develop this application
Please suggest me.
1) Absolutely possible. The "how" depends quite a lot on what specifically you are doing and how well templates fit your patterns (or how well your needs can be distilled to code generation in general).
2) Impossible to say. Depends entirely on your needs.
You should really investigate ADO.NET Data Services and ASP.NET Dynamic Data Scaffolding frameworks. These are designed exactly to do the kind of generation you are asking for.
A bit late but checkout the codesmith templates I just released.
http://community.codesmithtools.com/CodeSmith/m/templates/42499.aspx