Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Dennis Lee Bieber Newsgroups: comp.lang.python Subject: Re: Recommendation for Object-Oriented systems to study Date: Mon, 30 May 2016 14:14:41 -0400 Organization: IISS Elusive Unicorn Lines: 47 Message-ID: References: <53b21136-68ce-485c-8ccb-d6d28dace9c5@googlegroups.com> <5tuokbhac6lbs602p4g64tpjepm1lro7vq@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de BOBmD9NwfCeVAMj6KJtOngw5UJiAeHfJMPYsAoVN/EAw== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'handler': 0.04; 'modify': 0.04; 'classes,': 0.05; 'assignment': 0.07; 'granted,': 0.07; 'override': 0.07; 'performs': 0.07; 'stack.': 0.07; 'logic': 0.09; 'message-id:@4ax.com': 0.09; 'methods,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'stack,': 0.09; 'subclass': 0.09; 'subject:Object': 0.09; 'tends': 0.09; 'python': 0.10; 'django': 0.13; 'intermediate': 0.15; '"values"': 0.16; '(object': 0.16; '(well,': 0.16; '2016': 0.16; 'attributes.': 0.16; 'c++)': 0.16; 'centralized': 0.16; 'constructs': 0.16; 'fancy': 0.16; 'macro': 0.16; 'operation,': 0.16; 'operation.': 0.16; 'parts.': 0.16; 'popping': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; "wouldn't": 0.16; 'first.': 0.18; 'implementing': 0.18; 'processor': 0.18; 'url:home': 0.18; 'programmer': 0.18; 'language': 0.19; 'foundation': 0.19; '(the': 0.22; 'class,': 0.22; 'keyboard': 0.22; 'latter': 0.22; 'oriented': 0.22; 'shifting': 0.22; 'code,': 0.23; 'code.': 0.23; "haven't": 0.24; 'second': 0.24; 'implemented': 0.24; 'header:X-Complaints-To:1': 0.26; 'updating': 0.27; 'function': 0.28; 'appending': 0.29; 'expose': 0.29; 'notation': 0.29; 'oop': 0.29; "i'm": 0.30; 'books': 0.30; 'classes': 0.30; 'code': 0.30; 'probably': 0.31; 'fixed': 0.31; 'implement': 0.32; 'class': 0.33; 'source': 0.33; 'common': 0.33; '-0700': 0.33; 'designs': 0.33; 'covered': 0.34; 'add': 0.34; 'text': 0.35; 'clear': 0.35; 'c++': 0.35; 'instance': 0.35; 'knowledge': 0.35; 'something': 0.35; 'but': 0.36; 'possible': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'being': 0.37; 'method': 0.37; 'received:org': 0.37; 'charset:us- ascii': 0.37; 'subject:-': 0.39; 'to:addr:python.org': 0.40; 'where': 0.40; 'some': 0.40; 'company': 0.60; 'identify': 0.61; 'back': 0.62; 'more': 0.63; 'results': 0.66; 'analysis': 0.72; 'hand': 0.82; 'action.': 0.84; 'calculator.': 0.84; 'design)': 0.84; 'nouns,': 0.84; 'tended': 0.84; 'dennis': 0.91 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: adsl-108-73-116-140.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <5tuokbhac6lbs602p4g64tpjepm1lro7vq@4ax.com> X-Mailman-Original-References: <53b21136-68ce-485c-8ccb-d6d28dace9c5@googlegroups.com> Xref: csiph.com comp.lang.python:109265 On Sun, 29 May 2016 07:42:04 -0700 (PDT), Ankush Thakur declaimed the following: >Hello, > >I'm a self-taught programmer who has managed to claw his way out of Python basics and even covered the intermediate parts. But I feel I have a ton of theory in my head and would like to see some smallish applications in action. More specifically, I'm looking for Object Oriented designs that will help me cement my knowledge and expose me to best practices that books never cover. I have half a mind to start reading up the Django or Pandas source code, but I don't want to overwhelm myself. > It is no clear if you want something for OOAD (object oriented Analysis and Design) or for OOP (object oriented Programming) -- though the latter works better with a foundation of the first. OOAD tends to be language independent (well, these days the texts probably focus on UML as the notation -- but UML is not implementation). With some difficulty, one can use a non-OO language to implement an OO design (the first C++ systems were fancy macro pre-processors that generated C source code; if one understands the type of constructs that produces, one can hand code the same). In a very simplistic form OOAD comes down to reading a text description of a task/system identifying nouns, verbs, and adjectives. The nouns are what might become OO Classes, the verbs identify possible methods, and adjectives may be attributes. 25 years ago, the common assignment in the OOAD/OOP (the second half being an intro to C++) classes my company gave was to design a simple calculator. The designs from most of the students tended to be "keyboard" containing a matrix of "keys" sending "function codes" to a centralized "processor" which then sent results to update the "display"... My design was "keyboard" with matrix of "keys" implementing functions by pulling/pushing "values" on a "stack", with the "stack" updating the "display" with the value on top of stack. If you haven't guessed -- my design is based on RPN calculators, and even entering digits was implemented by a digit key operation popping the top of stack, shifting left one digit, appending the new digit (the fixed value of the key), and pushing the result back onto the stack. Granted, you wouldn't make a hardware design where each key had a logic chip... But it made for a very clean design to add operations... Subclass the OperationKey class, override method that performs the operation. Add instance of new subclass to the"keyboard". The other students would have had to change both their keyboard matrix for a new operation, and modify the processor class to dispatch to a handler for a new function code. -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/