Jump to content

Talk:Facade pattern

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Needs work from someone knowledgeable

[edit]

This site needs tons of work. If anyone knows what a facade pattern is, then please, fix this page! All I could do was reorganize some of the information, but it requires clarity and an author who knows what a facade pattern reallly is. (I really don't.) Narcissus 00:24, 5 Oct 2003 (UTC)

This pattern is a very simple one. I guess it becomes clear as there's an example now. Lathspell 00:35, 17 February 2006 (UTC)[reply]

The idea of a Facade is to provide a simplified interface over more complex objects/API. The example here is not that but rather an application that uses a complex object/API. DamienG 13:12, 3 August 2006 (UTC)[reply]

Bad example?

[edit]

I don't think the example in the article is a good example of the Facade pattern. As I understand the pattern, it is very useful when you have lots of different parts of a subsystem and complicated dependencies between clients of the subsystem and the facilities this subsystem offers. The example is just providing some utility functions that make GregorianCalendar easier to use, that is far from what I would call a Facade. --Eduardo Habkost 21:40, 14 December 2006 (UTC)[reply]

I agree with you. How about this? ja:Facade パターン#利用例 --Trashtoy 06:51, 2 March 2007 (UTC)[reply]
Good. The DrivingSimulator example on ja:Facade パターン#利用例 looks much better than the GregorianCalendar example we have here. --Eduardo Habkost 01:02, 22 March 2007 (UTC)[reply]

Anti-Facade pattern?

[edit]

Does anyone know if there's a usual name for the inverse of the facade pattern? For example, if I have access to a monolithic library through a small interface but I want to make its internal state look like several interacting objects. Is there a word for that? —Ben FrantzDale 05:48, 13 April 2007 (UTC)[reply]


Yes - check out the Facet pattern: http://c2.com/cgi-bin/wiki?FacetPattern —Preceding unsigned comment added by 80.6.91.225 (talk) 11:29, 20 February 2008 (UTC)[reply]

Arrows

[edit]

Shouldn't the arrows in the figre be TOWARD the left-hand side packages rather than FROM them ? The facade class uses (hence depends on) these classes, not the other way around.

I think you are right. Requesting new (fixed) diagram. —Ben FrantzDale 19:10, 17 April 2007 (UTC)[reply]
In terms of UML the diagram is correct. The left hand packages are included into the facade, therefore the arrows go towards the facade. It's probably better explained the UML/class diagram page 85.180.64.104 19:23, 3 August 2007 (UTC)[reply]
I don't think the arrows in the diagram are correct. In UML, the dashed line represents a dependency and the arrowhead should indicate the direction of the dependency. As it stands now, the diagram reads "Package1 includes Facade".--69.255.144.218 05:52, 8 November 2007 (UTC)[reply]
I agree that the arrows are not correct. They show a dependency from the implementation packages to the facade, whereas it should be a dependency from the facade class to the packages. Arrows in dependencies are always drawn from client to supplier. —Pete Kirkham
I just want to also agree that it should be "package" <--- "facade"; the note correctly depicts classes being instantiated as local variables in the doSomething() method, just the arrow orientation is wrong. 13:57, 13 April 2012 (UTC)
if someone knows how to update the image (Wikimedia doesn't explain how to do this easily for newbs like me), you can regenerate it via this link: http://www.plantuml.com/plantuml/form?url=VT2n3i8W40RWdQUuiImamARHfOcZYukEX5vh8wLDeJ76z7by45zCa3HMqxX0kEydT-0kjUrKhnfm_cOmh7sj_T0Oeero3dRg-L05mfr0qHxQ1lsvjbL6oKWcOblebBwe2ZdBuoM-G2AHM22PI9BSr6WzZpIbLZzTKqJyYzZM8oW7Uq6-83u1qdoWEMp0uZKTCxgUI80MCn8pag3bZ6GYpLdeueUopBIWiI2PGt_C0bHnf-zOZtxeRSHGFCMh8q5RG1psyoKi3Fq2 Fuhrmanator (talk) 03:26, 12 February 2014 (UTC)[reply]
I managed to do it finally, but only uploaded it locally as I don't have a unified account for commons images. Fuhrmanator (talk) 16:26, 12 February 2014 (UTC)[reply]

class FacadePattern

[edit]
See Talk: Facade#Requested move

The class is FacadePattern not FaçadePattern. A Google of the terms returns:

  • 44,400 English pages for -Façade-pattern Facade-pattern -wikipedia
  • 16,200 English pages for Façade-pattern -Facade-pattern -wikipedia

The page was moved with no explanation from "facade pattern" to "façade pattern" at 15:10, 12 July 2006 by user:Andylucianowith no explanation for the move. Common usage (WP:NC) suggests that this page is at Facade pattern. So I am moving it back --Philip Baird Shearer 12:08, 25 October 2007 (UTC)[reply]

Object Oriented ?

[edit]

I think the first line should says that facade is a design pattern but not an "object oriented" design pattern.

Although the name itself may be related to the object-oriented paradigm the idea was used extensively well before object-oriented principles were formulated. (Perhaps another example of object orientation usurping pre-existing ideas.)

203.110.131.5 01:31, 26 October 2007 (UTC)[reply]

Any known example of the non-OO usage?Ggenellina (talk) 23:42, 2 October 2009 (UTC)[reply]


Javascript is already used as an example in this page, which is quite clearly not an Object-Oriented language, which would imply that facade is more of a design pattern, and not an OO pattern. —Preceding unsigned comment added by 121.219.117.92 (talk) 13:41, 25 May 2010 (UTC)[reply]

glue layer

[edit]

If there is not just one facade simplifying a set of api's, but several facades that simplify several sets of api's, the trem "glue layer" is common. I think this articel would be a good place to introduce and link to this term

Are all of these examples really necessary?

[edit]

There are examples in Java, C#, Python, PHP and JavaScript. All of the examples except for JavaScript use "plain old OOP" style programming and could really be merged into one example. JavaScript uses prototype-based OOP, so I think we could leave that as-is. Wikipedia is not intended for tutorials for any programming language or even programming in general, so I think we should use only Java and JavaScript examples. Herrn (talk) 14:44, 2 September 2010 (UTC)[reply]

Diagram Wrong?

[edit]

Hi,

I am no UML expert - but I think the depedency direction on the UML diagram is incorrect (wrong way).

Gawie — Preceding unsigned comment added by Gkellerman (talkcontribs) 07:22, 22 October 2011 (UTC)[reply]

I am a UML expert, and you are right. The dependencies labeled doSomething() should be from the Facade to the classes inside the subsystem it's the facade for, not the other way round. New diagram needed. I'll do one if I remember... Educres (talk) 21:28, 21 October 2012 (UTC)[reply]

New diagram done. Fuhrmanator (talk) 16:28, 12 February 2014 (UTC)[reply]

C++ Example

[edit]

The C++ example is bad. Classes without virtual functions should normally not be allocated with new. A lot of C++ beginners do this and it results in horrible code. — Preceding unsigned comment added by 91.7.62.241 (talk) 15:58, 18 February 2019 (UTC)[reply]

It is still bad. The extraneous use of unique_ptr adds pointless cognitive burden to the example. A program with this much text can easily demonstrate a tight coupling manifestly if it is not wasted on extraneous constructs. 184.102.64.32 (talk) 07:05, 7 July 2020 (UTC)[reply]

Source 2 "The Facade design pattern - Problem, Solution, and Applicability"

[edit]

The second source "http://w3sdesign.com/?gr=s05&ugr=proble." is currently a dead link. (This is the same for the entire webpage [1] as well.) NulledRetry (talk) 15:19, 22 November 2023 (UTC)[reply]