It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
I saw AsP.NET Design Patterns Here
how can i understand which Design Pattern is Appropriate for our Projects?
most of our projects are Office Automation Projects.
I Had Never Used Any ASP.NET Design pattern In my projects.
just i used microsoft nettiers
Thanks.
I dont think any one can tell you which design pattern would be the best for your project. Because each design pattern solves some particular problem. And, you just have to choose a design pattern depending on the problem you want to solve in your project. You can also use combinations of design patterns to solve some particular problems.
Design patterns are efficient solutions for commonly faced problems and are generally used so that you dont reinvent the wheel. As you say you dont know much about design patterns I would suggest you to pick up some book to learn about design patterns. Head first design patterns was the first book I read about design patterns.You can start with that book. It will help you understand a number of commonly used design patterns and which pattern to use and when.
The design patterns to be found on your linked page (i.e. Factory pattern, Observer pattern, Decorator pattern, etc.) have a very general purpose and are helpful to design specific tasks in any kind of application framework and programming language. Usually a large application won't follow only one of them but will contain a mix of several of these pattern. They are not specific to ASP.NET.
Perhaps you are looking more for a design pattern which helps to create a clear and maintainable structure of an application as a whole. For ASP.NET Webforms a widely used application pattern is the Model-View-Presenter or MVP pattern which helps you to seperate concerns (for instance separate business logic from UI/code-behind logic) and improves automated testability for Webforms applications.
You can read more about the MVP pattern in relation to ASP.NET Webforms here (a brief introduction which also explains the various flavors of the pattern (like Passive View and Supervising Controller)) and more in detail here. (Last but not least combining the terms "ASP.NET", "Webforms", "MVP" or similar in your favourite search engine will reveal a lot more resources.)
Edit: Just to add one link more I just discovered: http://webformsmvp.com seems to be a website which focusses exclusively on the MVP pattern in ASP.NET Webforms.
Maybe check out this website to get an idea of the patterns available and when to use them:
http://www.dofactory.com/Patterns/Patterns.aspx
But again as #Pavanred says, it really depends what you want to use them for.
Related
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
What are the limitations of using ApplicationBlocks (An Introduction and Overview of the Microsoft Application Blocks) for ASP.NET/VB.NET applications? I have found lots of websites that talk about the benefits e.g. divorcing the data tier from the web tier, but I cannot find a web page that discusses the limitations.
I don't think you can really get a plain list of disadvantages. Microsoft Enterprise Library is a good library, well documented, rich and with tons of features.
You should change your question to "When I do not need to use it?". Of course this question should be repeated for each block. I'll try to summarize a little bit.
For every block you should consider to do not use the library when you do not need its complexity. Features doesn't come without a cost and the most obvious one is complexity (first in deploying and configuration). If you have to document and your user have to change application's configuration you may need to provide some tool or a lot of documentation. Complexity can be hidden in code too, even if EL designers tried to make everything easy it can't be as easy as a raw solution.
Second important disadvantage is obviously the speed. Layers of abstraction can't be for free and you'll pay a speed cost for that. In some cases you may do not care (simple Logging, for example) but it may be a problem in other cases (so again the answer is "it depends"). Think, for example, to Unity Application Block: you'll get all the power of injection but you'll pay a great cost for this.
So when you should use it? In my opinion a big goal of this library is that you do not need to use it all together. You can pick blocks you need when you need them. It's very common, for example, to use Logging and Exception Handling but you may not need Unity in whole your life. The Data Access Application Block is a very thin layer above ADO, it simplifies many common tasks but you do not gain the level of abstraction you have, for example, with LINQ to SQL or Entities (hey, do not forget they have very different purposes) and you should consider to use it only if everything else can't suit what you need.
So, finally, in my opinion you should consider each block and use it only and only if you really need all the complexity that comes with an Enterprise level library. It's not designed for small single user applications (even if sometimes you may find that some Application Blocks may be great for a specific task). Its drawbacks aren't little: complexity and speed can't be ignored (both for short term solution and long term maintenance plans). Moreover if you really need all its power you'll find it's not as easy as a "ready-to-go" solution, to have the control you'll need to write more code.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I see abstraction in processes.
I see abstraction in data.
I see that abstraction is losing the unimportant details.
I see that abstraction is giving a group of elements a name and treating them as one unit. (But I don't know why that is considered abstraction. So, please I need clarification on this particular point)
I know there are also levels of abstraction, and although the name implies something, I don't have a practical example, and I can't think of a specific one I'm confused about the definition of abstraction.
Can somebody write a comprehensive article? Scratch that. Can somebody give a comprehensive answer?
EDIT:-
Thank you for your answers.
However, I was looking for a generalized answer.
For example, I'm reading an article in which procedures are considered abstractions.
However, here the answers are about abstract classes in C# and Java, (until now.)
Thank you again.
Abstraction is the technique of hiding implementation. At it's core there's not much more to that answer. The bulk of meaning to abstraction come from how and why it is used.
It is used for the following scenarios
Reduce complexity. (Create a simple interface)
Allow for implementation to be modified without impacting its users.
Create a common interface to support polymorphism (treating all implementations of the abstracted layer the same.
Force users to extend the implementation rather than modify.
Support cross platform by changing the implementation per platform.
Quite simply, abstraction is the art of limiting your dependencies. The less you depend on, the more abstract you are. For example, if you write a DirectX renderer, then you're abstracted from what graphics card vendor and model you're running on. If you write another layer, you can be insulated from what OS you're running on.
Abstraction is hiding details of specific implementations and share common details among implementations. Example is java.util.List, java.util.ArrayList and java.util.Map. List is the parent (the abstraction), ArrayList and Map are specific implementation.
You want to do this whenever you have shared code between different classes, so that you don't repeat your code which is bad.
Abstraction is very useful in code reuse, dynamic behavior and standardization. For example, there is a method that you are using and it accepts a List, so to use this method, you can send any object that has list as its parent. Now inside this method, there could be different implementations depending on what is the type of the passed object, so you can achieve a dynamic behavior at run-time. This is very useful technique when you design a framework.
I am not sure if you are supposed to recommend books and if so let me know and I will delete my post but I like Pro C# by Troelsen. Abstraction is like an Interfaces but Interfaces do not allow you to define constructor(s). It is for generalizing. Like I have a grid I want to display some user fields in. The fields can be text, enumeration, single-value, multi-value. I built an abstract class FieldDef with an abstract string property DispValue. Then the various field type inherit from FieldDef. In the grid I have simple string to display. Then when the user updates a field properties and methods specific to the field type are exposed. The other example is all mammals have common proprieties but as you drill down you expose more properties but there is a single generalized view (interface) for all mammals and by inheriting from mammals there is a way to search across and display properties common to all mammals.
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.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
This is more of a design question than a problem I'm trying to solve. I'm posting this here to get other people's opinion on the Design of the ASP.NET MVC framework.
To start with, I'll state the issues I have with the framework:
Html and code in views
Method names such as View() where one can't discern by looking at the name what it is doing and that it actually returns something
Too many overloaded methods that accept completely different parameters (like View())
Html Helpers - I don't believe Extension method were introduced for this use
ViewData
I'm not explaining in detail the issues I have have with the above in the hopes that there are others who see the problems I see. To be honest, I haven't anyone bring up these issues so I'm beginning to wonder if I'm alone :).
Someone somewhere must see/feel these issues when building large applications no?
Someone somewhere must see/feel these issues when building large applications no?
No, not really. At least - I don't call those as an issues.
Html and code in views
Simple if or foreach won't cut Your head off. Way much easier than this:
<asp:Repeater ID="uberRepeater" runat="server">
<HeaderTemplate></HeaderTemplate>
<ItemTemplate></ItemTemplate>
<FooterTemplate></FooterTemplate>
</asp:Repeater>
If You put there complex things, it's not fault of framework, it's fault of developer and his misunderstanding of mvc pattern.
Method names such as View() where one can't discern by looking at the name what it is doing and that it actually returns something
Makes perfect sense to me:
It might not, if developer is not familiar with mvc pattern and conventions asp.net mvc follows.
Too many overloaded methods that accept completely different parameters (like View())
It might seem like a problem. But with c# 4.0, if it bothers You, You can use named parameters to keep code readable.
Html Helpers - I don't believe Extension method were introduced for this use
Extension methods indeed weren't introduced for html helpers. They were introduced to hook additionally logic to existing classes. It was must have feature in order to implement LINQ successfully.
Can't see that as an issue though.
ViewData
Emmm.... huh?
But that does not mean issues don't exist. They do exist.
E.g. - huge part of Mvc V3 is about proper support for dependency injection.
ASP.NET MVC Framework is powerfull. You have a complete control of HTML/client scripting output.
If you use it the right way and with a good infrastructure like SharpArchitecture you can achieve way more in user experience compared to any other framework (except silverlight).
In my experience, with the framework 4, asp.net mvc, a nice ORM (like hibernate), a DDD architecture, good patterns and an IoC, you save 30% of your project time and spend it on user experience.
Side note : SharpArchitecture is great architecture example, in fact, it is perfectible, but even out of the box, it can handle any size of project. With my experience since MVC1, I just can't imagine any large project without ASP.NET MVC, and it is more and more powerfull as the community is so creative and skillfull.
By way of answering this, I'd direct you to a book that does quite a good job it: Professional ASP.NET Design Patterns by Scott Millett. The book takes the most popular patterns, including those documented by the "Gang of Four" and the enterprise patterns of Martin Fowler, and discusses them in terms of all ASP.NET app types, including MVC.
If he can't convince you that MVC offers advantages in partitioning user display, business logic, and data store, probably no one will
#Buggieboy, I'm not questioning the MVC design pattern or the virtues thereof. My question is really related to the implementation/design of the ASP.NET MVC framework.
I guess I'm not talking to an objective crowd. Or as jfar says, I'm probably alone.
We are going to develop content Management System in ASP.net.Please suggest us what is the good design pattern do we need to follow in order to have good design.
What design are you looking for?
User interface? Even that question depends on who your user audience is going to be. You design a system for tech-savvy users differently than one designed so that "grandma" can use it.
Business Objects?
Database table and stored procedure design?
Coding standards?
This is way too vague for an answer that could be of any practical help.
I belief it's not the right start to search for usefull patterns first.
Take a look at Graig Larmans Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and Iterative Development
It's all about the design. First write down the requirements. What do you want to develop. What should the features be. The Applying UML book is very clear about this. I can't explain it in a few sentences.