Results 1 to 3 of 3
  1. #1
    sandeepsai39 is offline Member
    Join Date
    Feb 2009
    Posts
    96
    Rep Power
    0

    Default confusion with Design Pttern in java

    Hi to all, Iam learning Design patterns in java, i have a doubt with Design Pattern,Design pattern defined as open for source to extension and closed for
    modification.I didn't see any difference between this pattern and Observer Pattern or Strategy Pattern,we can use this Pattern instead of Design Pattern why it is introdused and what is mean by closed for modification in source from which we are extending.

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,772
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by sandeepsai39 View Post
    Hi to all, Iam learning Design patterns in java, i have a doubt with Design Pattern,Design pattern defined as open for source to extension and closed for
    modification.I didn't see any difference between this pattern and Observer Pattern or Strategy Pattern,we can use this Pattern instead of Design Pattern why it is introdused and what is mean by closed for modification in source from which we are extending.
    Closed for modification implies that you don't have any need to modify the original source code; open for extension means that you can add functionality to the pattern (mostly done through extension of classes).

    You can't do both with the Observer/Observable pattern. The other pattern is ususally implemented as a 'framework'.

    kind regards,

    Jos

  3. #3
    sandeepsai39 is offline Member
    Join Date
    Feb 2009
    Posts
    96
    Rep Power
    0

Similar Threads

  1. Java design patterns
    By ajeeb in forum New To Java
    Replies: 4
    Last Post: 03-03-2009, 06:10 PM
  2. Java Design Problem
    By hencre in forum Advanced Java
    Replies: 2
    Last Post: 02-25-2009, 08:08 AM
  3. overall design of a java application
    By willemjav in forum New To Java
    Replies: 2
    Last Post: 08-20-2008, 12:37 AM
  4. A few questions about Java and design
    By ldb88 in forum New To Java
    Replies: 4
    Last Post: 12-07-2007, 01:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •