HTML5 Canvas for Dummies
  • HTML5 Canvas For Dummies
    HTML5 Canvas For Dummies
    by Don Cowan
Search Our Site
Contact

tel. 970 708 0899

fax. 970 497 4377

contact@marketimpacts.com

Email Us
This form does not yet contain any fields.
    Search Our Website
    This area does not yet contain any content.
    Free QuickClick App Downloads

    Click below to download free QuickClick apps for your Android smartphone... 

    ATM

     

    Auto

     

    Casinos

     

    Coffee

     

    Dessert

     

    English Places

     

    Fast Food

     

    French Places

     

    Gas

     

    Golf

     

    Health Food

     

    Irish Places

     

    Italian Places

     

    Lodging

     

    Mail

     

    Nightlife

     

    Parking

     

    Restaurants

     

    RV

     

    Scottish Places

     

    Shopping 

     

    Taxi


    Truck

    Custom Apps

    Get a custom QuickClick app for your business. Use the format you see here or let us create a custom format tailored to your needs.

      

    « Bridge Design Pattern | Main | Which is the Best Browser »
    Wednesday
    Oct032012

    Adapter Design Pattern

    This entry is part of a series on programming Design Patterns that provides a framework for the rapid recall and use of patterns during application design. 

    The Adapter design pattern is used to wrap a class in code that allows that class to be used via a different interface. Another name for the pattern is a Wrapper.

    To understand how this pattern might be used, consider how software to display an image on a fixed size device might be constructed. Assume the following class and method are provided by the standard device software:

    class Display - contains methods to create displays on the device.

    displayImage(source) - method that displays an image with the dimensions of the device screen.

    An adapter would fit an image of any size to the device screen:

    class DisplayAdapter - contains methods that fit an image of any size to the device screen.

    imageAdapter(original) - method that changes the size of the original image to fit the display screen.

    imageResample(original, resized) - method that resamples the image for size change.

    displayImage(resized) - uses the method built into the device to display the resized image.

    PrintView Printer Friendly Version

    EmailEmail Article to Friend

    References (4)

    References allow you to track sources for this article, as well as articles that were written in response to this article.

    Reader Comments

    There are no comments for this journal entry. To create a new comment, use the form below.

    PostPost a New Comment

    Enter your information below to add a new comment.

    My response is on my own website »
    Author Email (optional):
    Author URL (optional):
    Post:
     
    Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>