Search Results

Search found 51 results on 3 pages for 'gof'.

Page 1/3 | 1 2 3  | Next Page >

  • Explanation of the definition of interface inheritance as described in GoF book

    - by Geek
    I am reading the first chapter of the Gof book. Section 1.6 discusses about class vs interface inheritance: Class versus Interface Inheritance It's important to understand the difference between an object's class and its type. An object's class defines how the object is implemented.The class defines the object's internal state and the implementation of its operations.In contrast,an object's type only refers to its interface--the set of requests on which it can respond. An object can have many types, and objects of different classes can have the same type. Of course, there's a close relationship between class and type. Because a class defines the operations an object can perform, it also defines the object's type . When we say that an object is an instance of a class, we imply that the object supports the interface defined by the class. Languages like c++ and Eiffel use classes to specify both an object's type and its implementation. Smalltalk programs do not declare the types of variables; consequently,the compiler does not check that the types of objects assigned to a variable are subtypes of the variable's type. Sending a message requires checking that the class of the receiver implements the message, but it doesn't require checking that the receiver is an instance of a particular class. It's also important to understand the difference between class inheritance and interface inheritance (or subtyping). Class inheritance defines an object's implementation in terms of another object's implementation. In short, it's a mechanism for code and representation sharing. In contrast,interface inheritance(or subtyping) describes when an object can be used in place of another. I am familiar with the Java and JavaScript programming language and not really familiar with either C++ or Smalltalk or Eiffel as mentioned here. So I am trying to map the concepts discussed here to Java's way of doing classes, inheritance and interfaces. This is how I think of of these concepts in Java: In Java a class is always a blueprint for the objects it produces and what interface(as in "set of all possible requests that the object can respond to") an object of that class possess is defined during compilation stage only because the class of the object would have implemented those interfaces. The requests that an object of that class can respond to is the set of all the methods that are in the class(including those implemented for the interfaces that this class implements). My specific questions are: Am I right in saying that Java's way is more similar to C++ as described in the third paragraph. I do not understand what is meant by interface inheritance in the last paragraph. In Java interface inheritance is one interface extending from another interface. But I think the word interface has some other overloaded meaning here. Can some one provide an example in Java of what is meant by interface inheritance here so that I understand it better?

    Read the article

  • Design Patters in Rails

    - by Winston
    I remember, I have a GoF book back in college about design patterns which helped me a lot with my C and C++ programming, since my jump ship to Rails I was trying to use those design patterns I learned previously, Rails is a relatively new paradigm to me, plurals, verbs, REST, DRY.. Can you give me a recommended book for Rails that I can easily understand what I previously learned back in College. P.S. I suspect Matz knew about the GoF book, and applied it on Ruby... :-)

    Read the article

  • GoF Design Patterns - which ones do you actually use?

    - by CraigS
    I'm trying to educate my colleagues in the area of design patterns. Some of the original Gang of Four patterns are a little esoteric, so I'm wondering if there is a sub-group of "essential" patterns that all programmers should know. As I look through the list, I think I've probably used - Abstract Factory Factory Method Singleton Bridge Facade Command Which ones do you actually use in practice, and what do you use them for? Link for those wanting a list of patterns

    Read the article

  • should the builder reset its build environment after delivering the product

    - by Sudhi
    I am implementing a builder where in the deliverable is retrieved by calling Builder::getProduct() . The director asks various parts to build Builder::buildPartA() , Builder::buildPartB() etc. in order to completely build the product. My question is, once the product is delivered by the Builder by calling Builder::getProduct(), should it reset its environment (Builder::partA = NULL;, Builder::partB = NULL;) so that it is ready to build another product? (with same or different configuration?) I ask this as I am using PHP wherein the objects are by default passed by reference (nope, I don't want to clone them, as one of their field is a Resource) . However, even if you think from a language agnostic point of view, should the Builder reset its build environment ? If your answer is 'it depends on the case' what use cases would justify reseting the environment (and other way round) ? For the sake of providing code sample here's my Builder::gerProcessor() which shows what I mean by reseting the environment /** * @see IBuilder::getProessor() */ public function getProcessor() { if($this->_processor == NULL) { throw new LogicException('Processor not yet built!'); } else { $retval = $this->_processor; $this->_product = NULL, $this->_processor = NULL; } return $retval; }

    Read the article

  • Design patterns and multiple programming language

    - by Eduard Florinescu
    I am referring here to the design patterns found in the GOF book. First how I see it, there are a few peculiarities to design pattern and knowing multiple language knowledge, for example in Java you really need a singleton but in Python you can do without it you write a module, I saw somewhere a wiki trying to write all GOF patterns for JavaScript and the entries where empty, I guess because it might be a daunting task. If there is someone who is using design patterns and is programming in multiple programming languages supporting the OOP paradigm and can give me a hint on how should I approach design patterns that might help me in all languages I use(Java, JavaScript, Python, Ruby): Can I write good application without knowing exactly the GOF design patterns or I might need some of them which might be crucial and if yes which one, are they alternatives to GOF for specific languages, and should a programmer or a team make its own design patterns set?

    Read the article

  • Design patterns and multiple programming languages

    - by Eduard Florinescu
    I am referring here to the design patterns found in the GOF book. First, how I see it, there are a few peculiarities to design pattern and knowing multiple languages, for example in Java you really need a singleton but in Python you can do without it you write a module, I saw somewhere a wiki trying to write all GOF patterns for JavaScript and all the entries were empty, I guess because it might be a daunting task to do that adaptation. If there is someone who is using design patterns and is programming multiple languages supporting the OOP paradigm and can give me a hint on how should I approach design patterns. An approach that might help me in all languages I use(Java, JavaScript, Python, Ruby): Can I write good application without knowing exactly the GOF design patterns or I might need just some of them which might be crucial and if yes which one, are there alternatives to GOF for specific languages, and should a programmer or a team make their own design patterns set?

    Read the article

  • Design Patterns: Should I learn them?

    - by prelic
    So it's kinda weird asking two questions back-to-back, but they aren't very related and I didn't want to combine them, but I'm not spamming questions, I promise! Anyway, I'm a recent college grad, and my education only touched on design patterns...we implemented a few simple ones, touched on the fact that there were more complicated ones, and were instructed to turn to the GoF book if we wanted to learn more. My question is, is it worth learning the patterns in the GoF book? To me, it's always seemed counter-intuitive to try and make a problem fit a classic pattern, but obviously the book, and the patterns, are famous for a reason. Do they show up enough that I should be learning them? Thanks again!

    Read the article

  • What modern design pattern / software engineering books for Java SE 6 do you recommend ?

    - by Scott Davies
    Hi, I am very familiar with Java 6 SE language features and am now looking for modern books that cover design patterns in Java for beginners as well as software engineering books that discuss architectures, algorithms and best practices in Java coding (sort of like the Effective C# books). I am aware of the classic GoF design patterns book, however, I'd like a more modern reference that takes advantage of the features of Java 6 SE. What books would you recommend ? Thanks, Scott

    Read the article

  • Book Review: Professional ASP.NET Design Patterns by Scott Millett

    - by Sam Abraham
    In the next few lines, I will be providing a brief review of Wrox’s Professional ASP.NET Design Patterns by Scott Millett. Design patterns have been a hot topic for many years as developers looked to do more with less, re-use as much code as possible by creating common libraries, as well as make their code easier to understand, extend and collaborate on. Scott Millett’s book covered classic and emerging patterns in a practical presentation that demonstrated with thorough examples how to put each pattern to use in the context of multi-tiered ASP.NET applications. The author’s unique approach and content earned him much kudos in the foreword by Scott Hanselman as well as online reviews. The book has 14 chapters of which 5 are dedicated to a comprehensive case study. Patterns covered therein include S.O.L.I.D, Gang of Four (GoF) as well as Martin Fowler’s Patterns of Enterprise Applications. Many thanks to the Wiley/Wrox User Group Program for their support of our West Palm Beach Developers’ Group. Best regards, --Sam You can access my reviews of books I recently read: Professional WCF 4.0 Inside Windows Communication Foundation Inside Microsoft SQL Server 2008 series

    Read the article

  • Help to understand the abstract factory pattern

    - by Chobeat
    I'm learning the 23 design patterns of the GoF. I think I've found a way to understand and simplify how the Abstract Factory works but I would like to know if this is a correct assumption or if I am wrong. What I want to know is if we can see the result of the Abstract Factory method as a matrix of possible products where there's a Product for every "Concrete Factory" x "AbstractProduct" where the Concrete Factory is a single implementation among the implementations of an AbstractFactory and an AbstractProduct is an interface among the interfaces to create Products. Is this correct or am I missing something?

    Read the article

  • Learning Asynchronous programming

    - by xenoterracide
    Asynchronous non-blocking event driven programming seems to be all the rage. I have a basic conceptual understanding of what this all means. However what I'm not sure is when and where my code can benefit from being asynchronous, or how to make blocking IO, non-blocking. I'm sure that I can simply use a library to do this, but I'm more interested in more in depth concepts, and the various ways to implement it myself. Are there any comprehensive/definitive books, or other resources on this subject (like GoF for Design Patterns, or K&R for C, tldp for things like bash)? (Note: I'm not sure if this is actually functionally an identical question to my question on Learning event driven programming)

    Read the article

  • How do we know to favour composition over generalisation is always the right choice?

    - by Carnotaurus
    Whether an object physically exists or not, we can choose to model it in different ways. We could arbitarily use generalisation or composition in many cases. However, the GoF principle of "favour composition over generalisation [sic]" guides us to use composition. So, when we model, for example, a line then we create a class that contains two members PointA and PointB of the type Point (composition) instead of extending Point (generalisation). This is just a simplified example of how we can arbitarily choose composition or inheritance to model, despite that objects are usually much more complex. How do we know that this is the right choice? It matters at least because there could be a ton of refactoring to do if it is wrong?

    Read the article

  • Design Pattern Books, Papers or Resources for Non-Object Orientated Paradigms?

    - by FinnNk
    After viewing this video on InfoQ about functional design patterns I was wondering what resources are out there on design patterns for non-object orientated paradigms. There are plenty out there for the OO world (GOF, etc, etc) and for architecture (EoEAA, etc, etc) but I'm not aware of what's out there for functional, logic, or other programming paradigms. Is there anything? A comment during the video suggests possibly not - does anyone know better? (By the way, by design patterns I don't mean language features or data structures but higher level approaches to designing an application - as discussed in the linked video)

    Read the article

  • Any learning/studying material for C/C++ that use game programming as learning context out there?

    - by mac
    As most of game programming is done - I read on this very site - in C/C++ I was wondering if there is any learning/studying material for C/C++ that would target specifically game programming. I am not looking for material about "developing games" or "software architecture for games", but rather for material that uses "game programming" as the CONTEXT for introducing and illustrating C/C++ features, idioms, programming techniques, etc... With a simile: think to the GOF book on design patterns. There, they used "developing a text-editor" as a context for introducing design patterns, but the book is most definitively not a book about "developing text-editors". Thanks in advance for your time and advice! PS: My background: I am a programmer with a solid experience in OO scripting languages and only some experience in C and Assembler (on AVR microcontrollers), so I am thinking to mid-to-advanced level material, rather than tutorials for beginners, although it might be interesting to take a look to the latter ones if nothing else is available.

    Read the article

  • Is there a 'design pattern' type listing of common algorithms?

    - by KevinM1
    Is there a 'design pattern' styled listing of common/popular algorithms anywhere? Specifically, something that has a similar format along the lines of: Algorithm Name: e.g., Quick Sort, Bubble Sort, etc. Problem: A description of the stereotypical problem the algorithm is supposed to address Description: Description of the solution Implementation: Code examples of the solution Big O Rating: Self-explanatory Similar Algorithms: Algorithms that address the same problem in different ways, or similar problems I really like the GoF design pattern listing style, and I think it would help me learn various algorithms better/easier if I could find a resource that was similar in terms of organization.

    Read the article

1 2 3  | Next Page >