This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
What are MVP and MVC and what is the difference?
I don't see any difference between MVP and MVC software architectures (MVC where controller implements mediator pattern), other than the name by which you call the mediator (presenter vs controller)
Can someone provide a clear explanation?
I care because I have a reasonable understanding of MVC via cocoa and I'm wondering how that knowledge will have to grow to understand MPF/C#/.NET
Darin's provided a good link. I'd say there are a couple key differences, but a lot of similarity. MVP's view is even simpler than MVVC's - it doesn't know about the model. That makes it easier to get everything covered by tests, IMHO. Also, it makes it easier to provide alternate views, for example, if you want both a GUI and a CLI. But, read the article, it covers the topic well.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I noticed that the Smalltalk language has no concept of private/protected methods. All methods are public. Coming from a Java/C++ background, I've thought of this as a fundamental weakness in the language as any application created in Smalltalk would be completely open to manipulation. I guess you could rely on naming conventions to document the public API and prefix methods to indicate them as private (I believe Squeak does this), but it's still completely open.
Are there any benefits to this approach over having explicit access modifiers to control
access to method invocations?
Indeed, the Smalltalk way is to put private methods in the 'private' category. This indicates that you shouldn't use these methods, but of course doesn't enforce this.
This is by design - it's a feature, not a bug. Smalltalk was designed from the beginning precisely to be an open system.
Some advantages:
If I simply have to - maybe the library designer didn't foresee a need to expose some particular thing I simply have to have - I can still call those private methods. Obviously, this isn't something one does lightly: rather, judiciously, cautiously, knowing that it's a tactical solution.
Language simplicity.
(As per Alexandre Jasmin's comment) Smalltalk makes no distinction between what you, the programmer, can do and what the language/environment can do. That means that Smalltalk-the-image exposes all the things needed for you to build your own inspectors/debuggers/whatever without having to supply special tools using we-can-do-this-but-you-can't techniques.
Private and protected methods are in fact a significant weakness of languages like c++, java and c#. They basically say to their users: I don't want to learn and evolve. The consequence of that (and a lot more early binding) is that those languages require much more BDUF and are thus far less usable for a modern (agile) development process.
The first question is what private/protected access modifiers are about? Fundamentally, it is not about safety or security. It is about exposing the right interface to the user. Starting from that, it makes little difference between having categories protected/private and a language construct specifically for that.
I would even say that having private/protected visibility modifier brings more complexity to the problem than it actually solves.
Besides that, I don't think that private/protected visibility is a good answer to this problem
At the least, Smalltalk should have the textual convention that method names that begin with 'underscore' are verboten to call outside of the objects themselves. Unfortunately, I don't think that 'underscore' is allowed as the first character of a method name.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I develop a software with Oracle form builder for my final thesis. I want to prepare some of software development document for my final thesis report.
as you know oracle forms blow ver 8.0 is procedural base... I use oracle form 6...
I need to prepare Software Requirement Specification (SRS) and Software design document (SDD) for my report.
the problem is, As we know oracle form is procedural base and it is not Object oriented base I used SSADM methodology for show how my forms are related(draw DFD,CFD,PSPEC)(use cases and flow up events[in uml]) together and their working in generally... right now for SDD I dont know how I should show my low level ,high level desing, and packages...
Which methodology you offer to me? right now I try to show my my low level ,high level desing by TOOD, but several days ago I find out TOOD is also for Obejct Oriented program,please help me...
One more question we can not use UML for funtional base program?Please with a strong reference plz...
I so worry that my examiner doesn't accept my work...
It is so hard drawing GUI by SSADM :(( plz help me...
I hope you expert people that gathering here can help me...
In my SRS template for UML project before I put : Usecase diagram,and sequence diagram.
and for SDD before in a OO prject I put : Class diagram, package ,component diagram and describe all my Class and than all of function of class (I dont know now how show them for my procedural base project :(( )
A history lesson.
The closest thing to an official methodology for building Oracle applications is the late Oracle*CASE Method. I doubt whether anybody has used it in a decade. Although it did exist as a process, really it was a guide to using Oracle CASE (subsequently Oracle Designer), which itself is a mothballed product.
CASE and Designer used variations on the SSADM product set. So in the analysis round we defined modules with DFDs. When it came to the design phase we decorated those definitions with the Design Editing tool with which we could specify the GUI elements. But I don't think that diagrammer had ties to any recognised methodology.
I would have included a link to some information about Oracle*CASE method, but it is so old it is pre-Internet (if you can imagine such a thing).
If the eTOOD approach allows you to describe Forms by all means use it. When it comes to GUI I don't think there's much difference between OO and procedural approaches. Although Jackson Structured Programming (or SDM) remains the best way of representing the flow through all the Forms triggers.
My key advice to you is talk to your examiner. Find out what they are expecting. Saying some random bloke at StackOverflow told you to use a certain methodology is unlikely to improve your grade.
According to Sun and Msdn it is a design pattern.
According to Wikipedia it is an architectural pattern
In comparison to design patterns, architectural patterns are larger in scale.
(Wikipedia - Architectural pattern)
Or it is an architectural pattern that also has a design pattern ?
Which one is true ?
MVC is more of an architectural pattern, but not for complete application. MVC mostly relates to the UI / interaction layer of an application. You're still going to need business logic layer, maybe some service layer and data access layer. That is, if you're into n-tier approach.
Why does one of them have to be true?
Both can be true, depending on point of view.
MVC can be an architectual pattern, if it forms the basis of the application architecture.
It can also be seen as simply a design pattern, an abstract notion that is applicable to any application.
Design patterns say how to write code effectively (considering Code Metrics).
A few benefits:
Easily Maintainable
High Re-usability
Readable because of abstractions
Architectural patterns say how to utilize resources effectively.
Parallel tasks execution like programmers and graphic designers can work parallel.
Multiple technologies can be utilized to build a software.
In MVC,
a). Views can be created using javascript templates and also html can be used
b). Controllers can be written .NET framework and
c). Models can be written in Java - a java service may be used that returns only json data.
While in design pattern, a pattern can't be implemented in which
code can be written in multiple technologies like AdminUser class in Java,
Customer class in C#, Partners class in Php and a factory pattern in Ruby
:); hmmm..so easy?:)
I know that it's been answered awhile ago, but no one has yet mentioned the book that made MVC famous: Pattern-Oriented Software Architecture (POSA), by Buschmann, et al published in 1996. Though not as widely read as the Design Patterns book, by Gamma, et al, POSA is one of the foundational books used by the patterns community.
Oh, and POSA very clearly identifies MVC as an architectural pattern. My hunch is that MS and Sun are just being sloppy and calling every pattern a "design pattern".
The design patterns inside the Model/View/Controller (MVC) triad of classes include and may not be limited to:
Observer, decoupling objects so that changes to one (the model) can affect any number of others (the views) without requiring the changed object (the model) to know details of the others (the views).
Composite, which lets us treat a group object (a composite view) just like we treat one of its individual objects (view components).
Strategy, where a view uses an instance of a Controller subclass to implement a particular response strategy; to implement a different strategy, simply replace the instance with a different kind of controller.
Factory Method, specifying the default controller class for a view.
Decorator, adding scrolling to a view.
Reference
Pages 4 to 6 (Section 1.2 Design Patterns in Smalltalk MVC)
Pages 293 to 304 (Observer design pattern)
Pages 163 to 174 (Composite design pattern)
Pages 315 to 324 (Strategy design pattern)
Pages 107 to 116 (Factory Method design pattern)
Pages 175 to 185 (Decorator design pattern)
Eric Gamma, Richard Helm, Ralph Johnson, and John Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, Reading, MA, 1994.
I think both are true. If you're looking at a particular instantiation of MVC in a framework like Ruby on Rails, that instantiation is more of a design pattern. If you look at MVC as a general concept, it's more of an architectural pattern.
If you put ten software architects into a room and have them discuss what the Model-View-Controller pattern is, you will end up with twelve different opinions. … Some of the purists out there will inevitably have qualms with what I refer to as “MVC”. Feel free to leave a flaming comment on the message board at the bottom of this Web page. I will gladly entertain different perspectives on what MVC means, but keep in mind that I do not care.
Josh Smith
MVC always mentioned and introduced as/in presentation layer in software architecture books.
Read these books:
Architecting Microsoft.NET Solutions for the Enterprise (Microsoft press)
Professional ASP.NET design patterns (Wrox)
Enterpise Solutions Patterns Using Microsoft.NET (Microsoft press)
Patterns of Enterprise Application Architecture (Addison Wesley)
A Practical Guide to Enterprise Architecture (Prentice Hall)
And according to Martin Fowler they are GUI architectures: Martin Fowler-GUI architectures
It depends on the size of the application, as it only affects GUI related classes, in a small one (mostly GUI) it could be considered an architectural pattern whereas in a huge one it would just be a design pattern that you apply to the GUI code (could be 10% of the apps code).
MVC is architecture pattern. Very clearly stated and shown at http://molecularsciences.org/zend/mvc_model_view_controller
I am developing my first ASP.NET MVC application using the Entity Framework. I have no previous .NET experience, although I'm fluent in other OO languages. I am having trouble understanding Linq to Entity query expressions, more specifically its syntax and how to render the results on an ASP page.
For example, I am joining three tables (entities) together and trying to iterate over the results, but I get all sorts of type errors. Every example I find on Google, SO, or MSFT hasn't been straightforward and each site takes their own approach. I looked at the book Programming Entity Framework, but this too seems to be over my head at the moment.
I am looking for clear, concise examples of executing the equivalent of complex multiple joins and iterating over the results.
Thanks
I've just started this myself, and I bought both the wrox book and the o'reilly one.
I've found the wrox one a little more inaccessible - the language used in it is a bit heavier, and the layout/organisation isn't quite so 'flowy' (is that a word? hehe).
The o'reilly one on the other hand is a cracking read, and really does lead you nicely through it. It's available on safaribooks too if you have a sub, I got it from Amazon who seemed one of the few places to have it in stock. Very much recommended.
take a look at these samples - http://blogs.msdn.com/adonet/archive/2007/03/13/101-linq-samples-updated.aspx
i picked up the concept from these examples itself
Scott Guthrie's blog has also really good explanation & samples
Sounds to me like you should get yourself a good book on the subject. Since you have no previous experience in .NET a general book that covers LINQ might be a start and then a ASP.NET-MVC specific one.
Perhaps the reason why being fluent in "other" OO languages isn't helping is that LINQ isn't an OO language, its much more functional and therefore takes a different way of reasoning to understand well.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
While going through university and from following the development of SO, I've heard a lot about the Model-View-Controller architectural design pattern. I inadvertently used the MVC pattern even before I knew what it was, and still use it in my everyday job. From what I've seen, it's probably the most popular pattern used today. What I haven't heard much about though, are the alternative patterns you can use instead of MVC. What options are there, and for what reasons would you decide to use them over MVC? I'm also interested in knowing the types of systems they are typical of being used for. Finally, what are the pros and cons that come along with using them?
Passive View - http://martinfowler.com/eaaDev/PassiveScreen.html
Supervising Controller - http://martinfowler.com/eaaDev/SupervisingPresenter.html
Model-View-Presenter - http://martinfowler.com/eaaDev/ModelViewPresenter.html
My personal favorite is the Passive View. More testable than others I've seen including MVC.
Some other architectural patterns including MVC.
Layered Systems
TCP/IP
Object-Oriented Organization
Model-View-Controller, Presentation-abstraction-control, Model View Presenter and Model View ViewModel.
Examples would be ASP.NET's MVC, Ruby on Rails, and bunch of others.
Event Based, Implicit invocation
Browser environment (DOM)
Pipe and filter architecture
Unix pipes
Repositories
Table Driven Interpreters
You may also find this paper by Garlan & Shaw on Software Architecture a nice read.
Another noteworthy link would be the article on architectural patterns at Wikipedia.
I've occasionally seen MVC without the C, where the view listens for changes in the model's data and alters rendering accordingly, and where the methods in the model are bound to event handlers for the view.
For projects where the view is by necessity tightly couple with the data (such as when there are visual components that directly relate to the model or attributes of the model), this can be rather useful, as it cuts out the "middle man."
I think many would argue, though, that this is still MVC, just a hybridized version, and that the bindings established between the view and model are controller logic.
Well, there's Model-View-Presenter, but I think you'll find that the most common "alternative" to MVC is really a lack of proper separation. As an extreme example, consider classic ASP pages where HTML, VBScript and SQL are found side-by-side in the same file. (That's not a bash of ASP — you'll find plenty of such examples in other languages.)
Although the above answers are quite correct, I think it's much more important to note that the words "design pattern" are completely unknown to 90% of all people who create software. They just start writing code.
The challenge is not selecting the best design approach, it's convincing others that design has value.
Well it is quite old now. I would like to mention one more (in the interest of info for additional knowledge) is PresenterFirst patrern
Here is more information on the same:
http://en.wikipedia.org/wiki/Presenter_First
http://www.atomicobject.com/pages/Presenter+First
HTH
The Presentation-Abstraction-Control (PAC) family of patterns, where interface/interaction is handled by a hierarchy of agents.
The wikipedia article is not great
http://en.m.wikipedia.org/wiki/Presentation-abstraction-control
In the Lift web framework we use a View First approach. Basically a view is composed of one or more snippets (somewhat similar to controllers) and snippets can be nested. This works very well with HTML and Scala's built-in XML processing capabilities.
You can roll your own MVC with the current ASP.NET framework and still keep the postback model.
http://www.codeproject.com/KB/aspnet/RollingYourOwnMVCwithASP.aspx
What about the Observer pattern. If I am not mistaken , MVC was introduced in Smalltalk and thereafter several publish/ subscribe patterns have come into picture.
The observer pattern (a subset of the publish/subscribe pattern) is a software design pattern in which an object, called the subject, maintains a list of its dependents, called observers, and notifies them automatically of any state changes, usually by calling one of their methods. It is mainly used to implement distributed event handling systems.
Ex : The Save button gets enabled in an editior, only when there is data to be saved. Another example of the observer pattern is Document View architecture in MFC, where in the view gets updated when the document changes .