Pattern Oop

When do I use a Design Pattern from inheritance?

this is an OOP question

I can't think of a condition or situation when to use a design pattern or an inheritance
thanks, I'll keep that in mind.

I'll also check that book you've told me. =)

Before that you should understand the what is design pattern and inheritance and then difference.

Design Pattern:
What is the design pattern?

If a problem occurs over and over again, a solution to that problem has been used effectively. That solution is described as a pattern. The design patterns are language-independent strategies for solving common object-oriented design problems. When you make a design, you should know the names of some common solutions. Learning design patterns is good for people to communicate each other effectively. In fact, you may have been familiar with some design patterns, you may not use well-known names to describe them. SUN suggests GOF (Gang Of Four--four pioneer guys who wrote a book named "Design Patterns"- Elements of Reusable Object-Oriented Software), so we use that book as our guide to describe solutions. Please make you be familiar with these terms and learn how other people solve the code problems.
Do I have to use the design pattern?

If you want to be a professional Java developer, you should know at least some popular solutions to coding problems. Such solutions have been proved efficient and effective by the experienced developers. These solutions are described as so-called design patterns. Learning design patterns speeds up your experience accumulation in OOA/OOD. Once you grasped them, you would be benefit from them for all your life and jump up yourselves to be a master of designing and developing. Furthermore, you will be able to use these terms to communicate with your fellows or assessors more effectively.

Many programmers with many years experience don't know design patterns, but as an Object-Oriented programmer, you have to know them well, especially for new Java programmers. Actually, when you solved a coding problem, you have used a design pattern. You may not use a popular name to describe it or may not choose an effective way to better intellectually control over what you built. Learning how the experienced developers to solve the coding problems and trying to use them in your project are a best way to earn your experience and certification.

Remember that learning the design patterns will really change how you design your code; not only will you be smarter but will you sound a lot smarter, too.
How many design patterns?

Many. A site says at least 250 existing patterns are used in OO world, including Spaghetti which refers to poor coding habits. The 23 design patterns by GOF are well known, and more are to be discovered on the way.

Note that the design patterns are not idioms or algorithms or components.
What is the relationship among these patterns?

Generally, to build a system, you may need many patterns to fit together. Different designer may use different patterns to solve the same problem. Usually:

* Some patterns naturally fit together
* One pattern may lead to another
* Some patterns are similar and alternative
* Patterns are discoverable and documentable
* Patterns are not methods or framework
* Patterns give you hint to solve a problem effectively

Inheritance:
It is nothing but creating new items containing an original item's features without changing the original item.
nheritance is a large part of the reason that Object Oriented Programming is a powerful tool. It has the following advantages:

* you can customize and enhance working classes
* it is easier to reuse code
* you can take a more general class and modify to suit a particular situation

Terminology
There are a number of terms that you need to know to follow the examples:

field:
a variable that is part of a class

method:
a function that is part of a class

constructor:
a special method that is called when an object is created

superclass:
the class that is inherited from (the parent class)

subclass:
the class the does the inheriting (the child class)
extendsin Java the keyword extends means that a class will inherit from another class

overload:
a method is overloaded if there are two or more methods with the same name in a class. Each overloaded method has a different set of parameters. That's how you can tell which one will get called.

override:
a method is overridden if there is a method in the subclass that has the same name and the same set of parameters. The superclass method is then NOT inherited.

Brightneedle Twin Hearts Sampler Book 10 Be Mine OOP
Brightneedle Twin Hearts Sampler Book 10 Be Mine OOP
$6.50
Time Remaining: 1h 28m
Buy It Now for only: $6.50

Cross Stitch Old Outhouse Wood Shed Spring Hosue Smoke House Log Cabin++1982 OOP
Cross Stitch Old Outhouse Wood Shed Spring Hosue Smoke House Log Cabin++1982 OOP
$2.50
Time Remaining: 11h 51m

Mothers Day Sampler Cross Stitch Pattern pages from OOP magazine Prov 3131
Mothers Day Sampler Cross Stitch Pattern pages from OOP magazine Prov 3131
$9.89
Time Remaining: 12h 31m
Buy It Now for only: $9.89

HB Cross Stitch Book Jutta Lammer Christmas Cross Stitch 1988 LK OOP
HB Cross Stitch Book Jutta Lammer Christmas Cross Stitch 1988 LK OOP
$3.00
Time Remaining: 13h 41m

The Hunt English fox hunt Cross Stitch Pattern pages from OOP magazine
The Hunt English fox hunt Cross Stitch Pattern pages from OOP magazine
$12.89
Time Remaining: 13h 50m
Buy It Now for only: $12.89

COUNTRY ABCS OOP
COUNTRY ABCS OOP
$2.99
Time Remaining: 14h 39m

BLOOMS OOP
BLOOMS OOP
$2.99
Time Remaining: 14h 40m

DOWNHOME A B CS   OOP CHART
DOWNHOME A B CS OOP CHART
$2.99
Time Remaining: 14h 41m

NOSTALGIC DESIGNS OOP
NOSTALGIC DESIGNS OOP
$2.99
Time Remaining: 14h 42m

BUIGS BUNNY  FRIENDS  OUT OF PRINT
BUIGS BUNNY FRIENDS OUT OF PRINT
$2.99
Time Remaining: 14h 42m

OLD FRIENDS OOP
OLD FRIENDS OOP
$2.99
Time Remaining: 14h 43m

Cross Stitch Designs By Well Know Designers LK 1992 OOP Sampler+++
Cross Stitch Designs By Well Know Designers LK 1992 OOP Sampler+++
$2.00
Time Remaining: 14h 45m

A FRIEND LIKE YOU OOP
A FRIEND LIKE YOU OOP
$2.99
Time Remaining: 14h 47m

FOLK ART COLLECTION JO SONJA GEESE  GIRL MINT OOP
FOLK ART COLLECTION JO SONJA GEESE GIRL MINT OOP
$4.99
Time Remaining: 14h 47m
Buy It Now for only: $4.99

HOME SAMPLER OOP
HOME SAMPLER OOP
$2.99
Time Remaining: 14h 48m

Astor Place A Watched Pot Never Boils Cross Stitch Chart Old Stove Rare 1987 OOP
Astor Place A Watched Pot Never Boils Cross Stitch Chart Old Stove Rare 1987 OOP
$6.99
Time Remaining: 14h 58m
Buy It Now for only: $6.99

LIFE SKILLS Sampler Cross Pattern pages from OOP magazine My mother taught me
LIFE SKILLS Sampler Cross Pattern pages from OOP magazine My mother taught me
$7.89
Time Remaining: 15h 19m
Buy It Now for only: $7.89

1909 St Nick Cross Stitch Chart Olde Santas Collection Santa Christmas Rare OOP
1909 St Nick Cross Stitch Chart Olde Santas Collection Santa Christmas Rare OOP
$4.99
Time Remaining: 16h 6m
Buy It Now for only: $4.99

LOVES JOY SAMPLER Cross Stitch Pattern pages from OOP publica Wedding Valentine
LOVES JOY SAMPLER Cross Stitch Pattern pages from OOP publica Wedding Valentine
$6.89
Time Remaining: 17h 34m
Buy It Now for only: $6.89

SUNNY SUNFLOWER Cross Stitch Pattern pages from OOP publication
SUNNY SUNFLOWER Cross Stitch Pattern pages from OOP publication
$5.89
Time Remaining: 17h 43m
Buy It Now for only: $5.89

A Bears Holiday Gordon Fraser Cross Stitch Book Classic Teddy Bears VINTAGE OOP
A Bears Holiday Gordon Fraser Cross Stitch Book Classic Teddy Bears VINTAGE OOP
$5.99
Time Remaining: 17h 44m
Buy It Now for only: $5.99

Sugar Plum Fairy Cross Stitch  Quilting Vanessa Ann OP Baby Nursery Animals OOP
Sugar Plum Fairy Cross Stitch Quilting Vanessa Ann OP Baby Nursery Animals OOP
$4.99
Time Remaining: 17h 57m
Buy It Now for only: $4.99

Alma Lynne The Bear Crossing Victorian Country Teddy Bears Cross stitch Book OOP
Alma Lynne The Bear Crossing Victorian Country Teddy Bears Cross stitch Book OOP
$4.99
Time Remaining: 17h 58m
Buy It Now for only: $4.99

Grandparents Day SIMPLE PLEASURES house Cross Stitch Pattern pages from OOP mag
Grandparents Day SIMPLE PLEASURES house Cross Stitch Pattern pages from OOP mag
$6.79
Time Remaining: 18h 3m
Buy It Now for only: $6.79

A Garden Variety Alma Lynne Cross Stitch Book Gardening Flowers Birds Towels OOP
A Garden Variety Alma Lynne Cross Stitch Book Gardening Flowers Birds Towels OOP
$4.99
Time Remaining: 18h 10m
Buy It Now for only: $4.99

Thanksgiving GIVING THANKS Pilgrim Cross Stitch Pattern pages from OOP magazine
Thanksgiving GIVING THANKS Pilgrim Cross Stitch Pattern pages from OOP magazine
$6.89
Time Remaining: 18h 14m
Buy It Now for only: $6.89

Country Scrapbook Polly Carbonari Cross Stitch Family Memories Folk Art Farm OOP
Country Scrapbook Polly Carbonari Cross Stitch Family Memories Folk Art Farm OOP
$4.99
Time Remaining: 18h 55m
Buy It Now for only: $4.99

Cross My Heart NATURALLY CATS II Calico  Persian Cats OOP
Cross My Heart NATURALLY CATS II Calico Persian Cats OOP
$3.99
Time Remaining: 20h 1m
Buy It Now for only: $3.99

Cross My Heart EDEN IN STAINED GLASS Tiffany Style OOP
Cross My Heart EDEN IN STAINED GLASS Tiffany Style OOP
$4.99
Time Remaining: 20h 2m
Buy It Now for only: $4.99

Cross Stitch Cozy Sweaters  Afghans Alma Lynne OOP
Cross Stitch Cozy Sweaters Afghans Alma Lynne OOP
$2.99
Time Remaining: 20h 58m
Buy It Now for only: $2.99

The Prairie Schooler Village Sampler  15 OOP
The Prairie Schooler Village Sampler 15 OOP
$35.00
Time Remaining: 21h 19m
Buy It Now for only: $35.00

The Prairie Schooler Prairie Wildflowers OOP
The Prairie Schooler Prairie Wildflowers OOP
$24.99
Time Remaining: 21h 34m
Buy It Now for only: $24.99

The Prairie Schooler Songs Of The Season  81 OOP
The Prairie Schooler Songs Of The Season 81 OOP
$29.99
Time Remaining: 21h 44m
Buy It Now for only: $29.99

The Prairie Schooler Village Christmas OOP
The Prairie Schooler Village Christmas OOP
$24.99
Time Remaining: 21h 56m
Buy It Now for only: $24.99

The Prairie Schooler Garden Alphabet  61 OOP
The Prairie Schooler Garden Alphabet 61 OOP
$29.99
Time Remaining: 22h 1m
Buy It Now for only: $29.99

VINTAGE MICKEY  MINNIE MOUSE DOLLS 18 OOP SEWING
VINTAGE MICKEY MINNIE MOUSE DOLLS 18 OOP SEWING
$24.99
Time Remaining: 22h 31m
Buy It Now for only: $24.99

A Sample of a Different Color Truswell Cross Stitch Sampler 2 Color Schemes OOP
A Sample of a Different Color Truswell Cross Stitch Sampler 2 Color Schemes OOP
$4.99
Time Remaining: 22h 51m
Buy It Now for only: $4.99

A Stitch in Time Cross Stitch Country Farm Animals OOP Cross My Heart Barn Shelf
A Stitch in Time Cross Stitch Country Farm Animals OOP Cross My Heart Barn Shelf
$4.99
Time Remaining: 22h 52m
Buy It Now for only: $4.99

CHRISTMAS HOUSE SAMPLER PEEK THROUGH THE WINDOWS PATRICIA ANDRLE CCS PATT OOP
CHRISTMAS HOUSE SAMPLER PEEK THROUGH THE WINDOWS PATRICIA ANDRLE CCS PATT OOP
$12.99
Time Remaining: 1d 57m

A Tisket a Tasket Vanessa Ann Cross Stitch Book Children Vegetables Nursery OOP
A Tisket a Tasket Vanessa Ann Cross Stitch Book Children Vegetables Nursery OOP
$4.99
Time Remaining: 1d 57m
Buy It Now for only: $4.99

ABC  Heart Bears Cricket Collection No 1 OUT OF PRINT Cross Stitch Collectible
ABC Heart Bears Cricket Collection No 1 OUT OF PRINT Cross Stitch Collectible
$4.99
Time Remaining: 1d 1h 4m
Buy It Now for only: $4.99

Especially Sweet Imaginating Wedding Samplers Bands For Pillows Cross Stitch OOP
Especially Sweet Imaginating Wedding Samplers Bands For Pillows Cross Stitch OOP
$4.99
Time Remaining: 1d 1h 16m
Buy It Now for only: $4.99

IRISH HO Leprehchaun Dancer Fanci Luck of the Cross Stitch Chrat St Patricks OOP
IRISH HO Leprehchaun Dancer Fanci Luck of the Cross Stitch Chrat St Patricks OOP
$5.99
Time Remaining: 1d 1h 53m
Buy It Now for only: $5.99

The Littlest Snowman Cross Stitch Elegant designs OOP Poem The House is Warm
The Littlest Snowman Cross Stitch Elegant designs OOP Poem The House is Warm
$4.99
Time Remaining: 1d 1h 54m
Buy It Now for only: $4.99

Wedding Marriage Sampler Anne Powell Heirloom Stitchery Cross Stitch Pattern OOP
Wedding Marriage Sampler Anne Powell Heirloom Stitchery Cross Stitch Pattern OOP
$8.99
Time Remaining: 1d 1h 55m
Buy It Now for only: $8.99

ON THE POND Cross Stitch Frog Cattail Water Lilies OOP
ON THE POND Cross Stitch Frog Cattail Water Lilies OOP
$6.95
Time Remaining: 1d 2h 52m
Buy It Now for only: $6.95

Shepherds Bush FOLK TALES Cross Stitch OOP 1980s Shepherd People Very UNIQUE
Shepherds Bush FOLK TALES Cross Stitch OOP 1980s Shepherd People Very UNIQUE
$22.99
Time Remaining: 1d 6h 50m
Buy It Now for only: $22.99

My Ladys Garden OOP Cross Stitch Chart Mirabilia
My Ladys Garden OOP Cross Stitch Chart Mirabilia
$8.99
Time Remaining: 1d 9h 43m

Creative Designers The LaFontaine Sampler by Susan L Coyle OOP
Creative Designers The LaFontaine Sampler by Susan L Coyle OOP
$5.00
Time Remaining: 1d 10h 7m

Cross Stitch Embroidery Religious Pattern Book In The Eyes Of The Lord OOP Mint
Cross Stitch Embroidery Religious Pattern Book In The Eyes Of The Lord OOP Mint
$3.99 (1 Bid)
Time Remaining: 1d 10h 38m

Cross Stitch Embroidery ASN 3601 Pattern Book 50 HOUSES by Sam Hawkins OOP Mint
Cross Stitch Embroidery ASN 3601 Pattern Book 50 HOUSES by Sam Hawkins OOP Mint
$1.99
Time Remaining: 1d 10h 47m

To the Beach JBW OOP Chart New
To the Beach JBW OOP Chart New
$2.95
Time Remaining: 1d 11h 4m
Buy It Now for only: $2.95

VtgCross Stitch Embroidery Gloria Pat Pattern Precious Moments ABCs Mint OOP
VtgCross Stitch Embroidery Gloria Pat Pattern Precious Moments ABCs Mint OOP
$8.99
Time Remaining: 1d 12h 5m
Buy It Now for only: $22.90

Mary Engelbreit BELIEVE cross stitch chart OOP Santa Claus designs  stocking
Mary Engelbreit BELIEVE cross stitch chart OOP Santa Claus designs stocking
$5.99
Time Remaining: 1d 12h 27m
Buy It Now for only: $9.95

Annie OOP  HTF
Annie OOP HTF
$2.99
Time Remaining: 1d 12h 38m

Raise the Roof Designs Funky Family cross stitch pattern NEW discontinued OOP
Raise the Roof Designs Funky Family cross stitch pattern NEW discontinued OOP
$1.00
Time Remaining: 1d 13h 28m

Raise the Roof Designs Ellens Flag cross stitch pattern NEW discontinued OOP
Raise the Roof Designs Ellens Flag cross stitch pattern NEW discontinued OOP
$1.00
Time Remaining: 1d 13h 28m

Raise the Roof Designs 50 50 2005 Christmas NEW out of print discontinued OOP
Raise the Roof Designs 50 50 2005 Christmas NEW out of print discontinued OOP
$1.00
Time Remaining: 1d 13h 29m

Raise the Roof Designs Low Carb Christmas pattern NEW discontinued OOP
Raise the Roof Designs Low Carb Christmas pattern NEW discontinued OOP
$1.00
Time Remaining: 1d 13h 30m

Raise the Roof Designs The Sweetest Thing pattern NEW discontinued OOP
Raise the Roof Designs The Sweetest Thing pattern NEW discontinued OOP
$1.00
Time Remaining: 1d 13h 30m

The Goode Huswife One Blue Bird Reproduction Sampler design OOP
The Goode Huswife One Blue Bird Reproduction Sampler design OOP
$18.00
Time Remaining: 1d 13h 50m

Assortment of 5 Sampler themed leaflets Some OOP
Assortment of 5 Sampler themed leaflets Some OOP
$5.00
Time Remaining: 1d 13h 52m

SANTAS ARK Cross Stitch Pattern Book Lovely Design of Santa On The Ark OOP
SANTAS ARK Cross Stitch Pattern Book Lovely Design of Santa On The Ark OOP
$2.00
Time Remaining: 1d 14h 22m
Buy It Now for only: $2.00

The Prairie Schooler No 20 St Nicholas Cross Stitch XS Pattern OOP Santa Claus
The Prairie Schooler No 20 St Nicholas Cross Stitch XS Pattern OOP Santa Claus
$6.00
Time Remaining: 1d 14h 59m
Buy It Now for only: $8.00

COUNTRY SEASONSOOP
COUNTRY SEASONSOOP
$3.00
Time Remaining: 1d 15h 34m

VINTAGEFOR ALL SEASONSOOP
VINTAGEFOR ALL SEASONSOOP
$3.00
Time Remaining: 1d 15h 41m

104 Gothic Monogram Designs a Deck of Cards from Bucilla OOP
104 Gothic Monogram Designs a Deck of Cards from Bucilla OOP
$7.99
Time Remaining: 1d 15h 50m
Buy It Now for only: $7.99

Ziggy Tis The Season 1981 OOP
Ziggy Tis The Season 1981 OOP
$2.99
Time Remaining: 1d 16h 32m

Ziggy Hope Your Day Is Special 1982 OOP
Ziggy Hope Your Day Is Special 1982 OOP
$2.99
Time Remaining: 1d 16h 34m

Gordon Frasers A Bear Book cross stitch OOP
Gordon Frasers A Bear Book cross stitch OOP
$6.00
Time Remaining: 1d 16h 36m
Buy It Now for only: $6.75

Ziggy looks like love 1981 OOP
Ziggy looks like love 1981 OOP
$2.99
Time Remaining: 1d 16h 36m

SARA VALENTINE LIZZIE HIGH ASTOR PLACE OOP ADORABLE
SARA VALENTINE LIZZIE HIGH ASTOR PLACE OOP ADORABLE
$0.75
Time Remaining: 1d 16h 51m

Blackbird Designs Tulip Manor Loose Feathers 7 OOP pattern
Blackbird Designs Tulip Manor Loose Feathers 7 OOP pattern
$20.00
Time Remaining: 1d 17h 19m
Buy It Now for only: $25.00

Congratulations TGIF cross stitch book OOP
Congratulations TGIF cross stitch book OOP
$4.75
Time Remaining: 1d 17h 30m
Buy It Now for only: $5.25

Vintage IMPERIAL DRAGON  PHOENIX Cross Stitch 1979 OOP NEW
Vintage IMPERIAL DRAGON PHOENIX Cross Stitch 1979 OOP NEW
$3.99
Time Remaining: 1d 17h 33m
Buy It Now for only: $5.00



Tags: , , , , , , ,  

Leave a Reply