Understanding Bridge Pattern using .NET
page 5 of 13
by David Simmonds
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 46965/ 125

Participants – Sample Code

Abstraction - Evaluations

This is a governing interface which ensures that any class which implements it can produce the expressions of work which are required.  In this case, the Evaluation MustInherit class ensures that all classes implementing it can hold a reference to a concrete implementer and call its method to produce the concrete results.

RefinedAbstraction – VerbalEvaluation, SlidingEvaluation, NumericEvaluation

These contain a function which generates a signal indicating the work to be done by the concrete implementation and also calls the implementation function on the implementer object which it holds a reference to, passing to it the signal which it has generated.  In this case, it is a UI control which captures an evaluation from the user and generates a rating value to pass to the rating-renderer.

Implementation - RatingRenderer

An interacting interface which ensures that classes implementing it can render the signal passed to it in a manner which completes the work to be done (by displaying a graphical representation of the rating).

ConcreteImplementation – FaceRenderer, StarRenderer, FishRenderer

This renders the signal into a tangible form which represents completed work.  In this sample code it renders the 1-to-5 rating in a visual form which represents increasing levels of rating.

Containable-Object-Group 1

Abstraction

RefinedAbstractions

Containable-Object-Group 2

Implementation

ConcreteImplementations


View Entire Article

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-05-18 9:51:30 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search