Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #78575

Re: Thoughts on python classes to represent an ebook reader

From Dennis Lee Bieber <wlfraed@ix.netcom.com>
Subject Re: Thoughts on python classes to represent an ebook reader
Date 2014-10-01 22:33 -0400
Organization IISS Elusive Unicorn
References <8cbce703-968f-4474-a013-063d7844c22a@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.14537.1412217188.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Wed, 1 Oct 2014 01:14:56 -0700 (PDT), math math <mathematisch@gmail.com>
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/

Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Thoughts on python classes to represent an ebook reader math math <mathematisch@gmail.com> - 2014-10-01 01:14 -0700
  Re: Thoughts on python classes to represent an ebook reader Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de> - 2014-10-01 10:48 +0200
  Re: Thoughts on python classes to represent an ebook reader Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-10-01 22:33 -0400

csiph-web