Path: csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'programmer': 0.03; 'classes,': 0.05; '(except': 0.07; '(of': 0.07; 'attributes': 0.09; 'oop': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; 'books': 0.15; 'class:': 0.16; 'example?': 0.16; 'help...': 0.16; 'implies': 0.16; 'list),': 0.16; 'message-id:@4ax.com': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:reader': 0.16; 'subject:python': 0.16; '(not': 0.18; 'wed,': 0.18; 'code,': 0.22; '(in': 0.22; 'candidates': 0.23; 'url:home': 0.24; 'math': 0.24; 'options': 0.25; 'class.': 0.26; 'mention': 0.26; 'task': 0.26; 'header:X-Complaints-To:1': 0.27; "doesn't": 0.30; 'purchased': 0.30; 'gives': 0.31; 'this.': 0.32; 'stuff': 0.32; 'reader': 0.33; 'problem': 0.35; 'classes': 0.35; 'but': 0.35; 'there': 0.35; 'really': 0.36; 'whilst': 0.36; 'method': 0.36; 'charset:us-ascii': 0.36; 'possible': 0.36; 'should': 0.36; 'too': 0.37; 'list': 0.37; 'starting': 0.37; 'focused': 0.38; 'to:addr:python-list': 0.38; 'previous': 0.38; 'rather': 0.38; '(from': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'users': 0.40; 'read': 0.60; 'hope': 0.61; 'identify': 0.61; 'new': 0.61; 'become': 0.64; 'life': 0.66; 'here': 0.66; 'experience.': 0.67; 'books.': 0.84; 'treating': 0.84; 'same,': 0.91; 'received:108': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: Thoughts on python classes to represent an ebook reader Date: Wed, 01 Oct 2014 22:33:05 -0400 Organization: IISS Elusive Unicorn References: <8cbce703-968f-4474-a013-063d7844c22a@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-108-79-217-224.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.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 47 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1412217188 news.xs4all.nl 2918 [2001:888:2000:d::a6]:59395 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:78575 On Wed, 1 Oct 2014 01:14:56 -0700 (PDT), math math declaimed the following: >Hi, > >I hope there are people here with strong OOP experience. > Whilst my previous life inflicted a few OOAD classes upon me, that life and my current one are too focused upon non-OO legacy stuff for the OOAD to be of help... However... >Which classes would an object-oriented python programmer create for the design of a e-book reader for example? I am not really interested in the code, just the OOP classes that would come to one's mind for a task like this. > >It should allow users to buy new e-books, view their list of purchased books and read the books. > A classical means of OOAD is to take the problem description and identify the /nouns/... Nouns are candidates for object classes (not all will become classes, but they are a starting point). Treating "e-book" and "book" as the same, your rather simplistic problem description gives me book list (of books) (implied) reader-device /Verbs/ are candidates for methods... You only have one method for each class: book.read list.view reader-device.buy /Adjectives/ indicate possible attributes of the class. Your one-liner doesn't have any (except "purchased", which implies some way to get a list of "unpurchased" books). A fuller problem description will likely mention a "shop", "filtering" (search), "selecting" (from the list), "paging" (in the reader), setting options (font/size/color scheme). -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/