Suppose I am responsible for developing the Scrabble game, as one of the main requirements of the client is the ability to try different ways and methods of the game later. I have already made a design that is flexible enough to support these changes. It remains only to leave a request to the client (access modifiers for objects) and how to organize it (how to expose my objects in namespaces / packages).
How can I define such things so that the client can easily use my standard implementation (the standard Scrabble game and still be able to make all the changes that he wants?) I assume that I need some kind of structure that he can work with .
I organized my classes / interfaces in a non-strict multi-level system:
Data types
Contains the basic data types that can be used throughout the system. Access to this package and its members can be obtained by any user in the system. All its members are publicly available.
Domain
Contains all the interfaces that I have defined, and which may be useful for creating new Scrabble implementations for clients. Also contains value types, such as Piece, which are used in the game. All its members are publicly available.
Implementation
Contains all the necessary classes / code for implementing my standard Scrabble game in the Implementations.StandardScrabble package. If the client decides to implement other variants of the game, he can create them in the Implementation. XYZ, for example. These classes are protected by all packages, and the only thing that is available outside the package is the facade of the game. Uses Domain and Data Types packages.
User interface
Contains a user interface class that I implemented so that both the client and users of the program can run the game (my implementation). Access to all other layers.
There are several drawbacks to how I organize things, the most obvious of which is that if a client wants to create his own version of the game, he will have to basically implement almost everything on his own (I share interfaces in the Domain, but he canβt do anything with them to do). I feel that perhaps I should pass all the implementation classes to the Domain and then only have the facade that creates my standard Scrabble in the "Implementations" namespace?
How would you approach this? Is there any recommended reading on how to create such programs (mostly frameworks)?
thanks
java c # oop frameworks uml
devoured elysium
source share