DOC PREVIEW
UMD CMSC 433 - Façade Pattern

This preview shows page 1 out of 3 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 3 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 3 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1CMSC 433 – Programming Language Technologies and ParadigmsSpring 2007Façade PatternApr. 05, 20072What is it?• Frequently, as your programs evolve and develop, they grow in complexity. • Furthermore, there may be a number of complicated subsystems, each of which has its own complex interface.• The Façade pattern allows you to simplify this complexity by providing a simplified interface to these subsystems. • This simplification may in some cases reduce the flexibility of the underlying classes, but usually provides all the function needed for all but the most sophisticated users.• These users can still, of course, access the underlying classes and methods.3For Example• Java provides a set of classes that connect to databases using an interface called JDBC. • You can connect to any database for which the manufacturer has provided a JDBC connection class -- almost every database on the market. • Some databases have direct connections using JDBC and a few allow connection to ODBC driver using the JDBC-ODBC bridge class.4For Example• To connect to a database, you use an instance of the Connection class. • Then, to find out the names of the database tables and fields, you need to get an instance of the DatabaseMetadata class from the Connection. • Next, to issue a query, you compose the SQL query string and use the Connection to create a Statement class.• By executing the statement, you obtain a ResultSet class, and to find out the names of the column rows in that ResultSet, you need to obtain an instance of the ResultsetMetadata class.• Thus, it can be quite difficult to juggle all of these classes and since most of the calls to their methods throw Exceptions, the coding can be messy.5In Pictures!6A Facade• By designing a Façade consisting of a Database class and a resultSet class (note the lowercase “r”), we can build a much more usable system.7Database Class8resultSet9Summary• The Façade pattern shields clients from complex subsystem components and provides a simpler programming interface for the general user. • However, it does not prevent the advanced user from going to the deeper, more complex classes when


View Full Document

UMD CMSC 433 - Façade Pattern

Documents in this Course
Trace 1

Trace 1

62 pages

Reflection

Reflection

137 pages

Testing

Testing

25 pages

Paradigms

Paradigms

10 pages

Testing

Testing

17 pages

Java RMI

Java RMI

17 pages

Java RMI

Java RMI

17 pages

Java RMI

Java RMI

17 pages

Trace 1

Trace 1

46 pages

Jini

Jini

4 pages

Final

Final

15 pages

Java RMI

Java RMI

13 pages

Testing

Testing

16 pages

Load more
Download Façade Pattern
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Façade Pattern and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Façade Pattern 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?