[[BackLinksMenu]] [[TicketQuery(summary=BASE_BOOK_COMMONS_R0, format=table, col=summary|owner|status|type|component|priority|effort|importance, rows=description|analysis_owners|analysis_reviewers|analysis_score|design_owners|design_reviewers|design_score|implementation_owners|implementation_reviewers|implementation_score|test_owners|test_reviewers|test_score|)]] = Analysis = == Overview == Manipulating with books is the main goal of sophie2. A book should hold pages, pages can be added or removed from a book. A book should be viewable, savable, exportable. == Task requirements == * Define the connections between books and other related objects (pages, some book repository) * Define actions related to books * for the book itself * create * destroy * copy * save/load * export * import * for the objects inside * add pages * remove pages * (re)order pages * group pages in chapters * set a page to be the cover of the book * other actions * merge two/many books in one * split a book in two/many * Decide which connections and actions are basic and obligatory and which are optional. Define a class hierarchy that supports the basic connections and actions. In this task a class hierarchy for books should be created. It should contain all interfaces, classes, fields common for all possible kinds of books (if any more than one) == Task result == * The result should include * class diagrams * source code == Implementation idea == * first identify the classes and the relations between them * implement the hierarchy * implement the functionality == Related == [wiki:BASE_MODEL_PAGE_ELEMENTS_R0][[BR]] [wiki:BASE_PERSISTENCE_COMMONS_R0][[BR]] [wiki:BASE_PERSISTENCE_INTERMEDIATE_STORAGE_R0] == How to demo == * show the class diagram and explain the role of the components and how they are related * show where the implemented packages and classes are = Design = The Book object model consists of three parts: * Model - in package org.sophie2.base.model.book * View - in package org.sophie2.main.view.book * Logic - in package org.sophie2.main.view.logic The basic actions for books are found in the following classes:[[BR]] [source:/trunk/sophie2-platform/modules/org.sophie2.base.model.book/src/main/java/org/sophie2/base/model/book/Book.java Book.java][[BR]] [source:/trunk/sophie2-platform/modules/org.sophie2.main.view/src/main/java/org/sophie2/main/view/book/BookView.java BookView.java][[BR]] [source:/trunk/sophie2-platform/modules/org.sophie2.main.view/src/main/java/org/sophie2/main/view/logic/BookLogic.java BookLogic.java] * These classes provide functionality for: * Creating and deleting books. * Adding/removing/reordering the pages of a book. * Some things will not be implemented in this task: * copying books requires the [wiki:PRO_LIB_UTILS_R0]. * saving/loading books will be implemented in the [wiki:BASE_PERSISTENCE_COMMONS_R0] task. * importing/exporting will be implemented at Iteration05 - then there are tasks for that. * grouping in chapters is scheduled for Iteration06. * other things might be implemented in the next revisions of this task. Here's the class diagram for these classes:[[BR]] [[Image(source:/trunk/sophie2-platform/doc/uml-design-diagrams/Book-Object-Model.png)]] Unit tests can be found here:[[BR]] [source:/trunk/sophie2-platform/modules/org.sophie2.base.model.book/src/test/java/org/sophie2/base/model/book/BookUnitTest.java BookUnitTest.java][[BR]] [source:/trunk/sophie2-platform/modules/org.sophie2.base.model.book/src/test/java/org/sophie2/base/model/book/PageUnitTest.java PageUnitTest.java][[BR]] [source:/trunk/sophie2-platform/modules/org.sophie2.main.view/src/test/java/org/sophie2/main/view/logic/AppBookPageLogicUnitTest.java AppBookPageLogicUnitTest.java][[BR]] [source:/trunk/sophie2-platform/modules/org.sophie2.main.view/src/test/java/org/sophie2/main/view/logic/BookLogicUnitTest.java BookLogicUnitTest.java][[BR]] [source:/trunk/sophie2-platform/modules/org.sophie2.main.view/src/test/java/org/sophie2/main/view/book/BookViewUnitTest.java BookViewUnitTest.java][[BR]] = Implementation = ^(Implementation results should be described and linked here (from the wiki or the repository))^ = Testing = = Comments = ^(Write comments for this or later revisions here.)