Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #78526 > unrolled thread
| Started by | math math <mathematisch@gmail.com> |
|---|---|
| First post | 2014-10-01 01:14 -0700 |
| Last post | 2014-10-01 22:33 -0400 |
| Articles | 3 — 3 participants |
Back to article view | Back to comp.lang.python
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
| From | math math <mathematisch@gmail.com> |
|---|---|
| Date | 2014-10-01 01:14 -0700 |
| Subject | Thoughts on python classes to represent an ebook reader |
| Message-ID | <8cbce703-968f-4474-a013-063d7844c22a@googlegroups.com> |
Hi, I hope there are people here with strong OOP experience. 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. I have made an attempt of class diagram here "http://imgur.com/9TR2Tlm" but I would be really glad to hear other opinions. I have not used any inheritance for example. I didn't know exactly where it would be handy and I also dont know if these classes are theoretically a good basis at all... Thanks a lot for comments/feedback. Felix
[toc] | [next] | [standalone]
| From | Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de> |
|---|---|
| Date | 2014-10-01 10:48 +0200 |
| Message-ID | <mailman.14510.1412154629.18130.python-list@python.org> |
| In reply to | #78526 |
On 01.10.2014 10:14, math math wrote: > Hi, > > I hope there are people here with strong OOP experience. > > 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. > > I have made an attempt of class diagram here "http://imgur.com/9TR2Tlm" but I would be really glad to hear other opinions. I have not used any inheritance for example. I didn't know exactly where it would be handy and I also dont know if these classes are theoretically a good basis at all... > > Thanks a lot for comments/feedback. > Felix > As it happens, the very popular Calibre ebook software is written in Python. So, I guess, getting (https://github.com/kovidgoyal/calibre) and looking at its source code should give you a good start. Wolfgang
[toc] | [prev] | [next] | [standalone]
| From | Dennis Lee Bieber <wlfraed@ix.netcom.com> |
|---|---|
| Date | 2014-10-01 22:33 -0400 |
| Message-ID | <mailman.14537.1412217188.18130.python-list@python.org> |
| In reply to | #78526 |
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/
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web