Design Pattern Implementation
hi guys,
My graduation project is on design patterns & how to develop a CASE tool to use each design pattern & modify it according to the developer needs !!!
But i have a question please !!! How can i implement a design pattern with java code !!! for example there's a pattern called a Bridge Pattern , It's role is to separate the user interface from the internal processing & calculations so either of them will not affect by any changing done in the other !!!
Please anyone give me an example or even ideas how i can impelement this in my CASE tool , i have to impelment all Design patterns & make the user use them , modify them & interconnect between them !!!
Thanks in advance .
[737 byte] By [
meaobaoa] at [2007-11-26 18:50:17]

# 1
Read the GOF book. All the patterns therein are illustrated with code and should give you some idea of how to go about realising a pattern.
# 2
I'll suggest Head First Design Pattern ,and this has examples in Java so you might be able to relate better.
# 3
all the suggestions are infact very good books, also you would like to take a look at the design patterns book by "Partha Kuchana".It's a good book, easy to understand.RegardsAyusman
# 4
i practice i have build a library for an individual pattern which containts only interfaces and abstract classes if possible. they correspond to the patterns in the various books
when i use a pattern for a implement or extend as appropriate.
I do this manually but if i was to make a case tool i would have it rough in the implementation of standard pattern jars.
also google about for the Pattern Enforcing Compiler.
# 5
having a part-baked library of pattern code isn't a good idea, IMHO. a pattern isn't implemented exactly the same way every time, and you'd probably find one of two things happening; your library will impose a possibly unsuitable design on you each time you use it, or you'll have to make the code so generalised you won't really gain anything over just starting from scratch each time. either way, you'll spend so much time tweaking and adjusting, and working around not-quite-suitable design, you won't have saved anything. the temptation will also be there to just reach for your favourite hammer at every opportunity. it also assumes that you'll get it right first time.
on the other hand, trying to do it might lead you somewhere else worthwhile. I tried to write a general-purpose abstract factory once, and ended up with a basic IoC container, before I'd even heard of IoC
# 6
I have use my pattern libs on a few projects over the years and never had a problem with them.
they didn't take long to make (mind you i haven't made all the patterns) and are very versitile.
You bring up very valid points, they are things that i previously considered, but those problems don't have to happen. i found that you do need to constrain the pattern library that you are developing to only perform its duties no more or less.
all-round it has work very well and been easy to maintain for my self and others across multiple software product lines.
# 7
> I have use my pattern libs on a few projects over the
> years and never had a problem with them.
>
> they didn't take long to make (mind you i haven't
> made all the patterns) and are very versitile.
>
> You bring up very valid points, they are things that
> i previously considered, but those problems don't
> have to happen. i found that you do need to
> constrain the pattern library that you are developing
> to only perform its duties no more or less.
>
> all-round it has work very well and been easy to
> maintain for my self and others across multiple
> software product lines.
hmmm. maybe I was still enjoying "little boy with pattern" syndrome back then, and over-egged it