| An overview of modeling | |
Golden rules on modeling
|
|
| Use case diagrams / specification | |
| Download Use Case reference material | |
| Adobe PDF |
|
|
Use cases are used during the analysis phase of a project to identify and partition system functionality. The system is divided into actors and use cases. Actors are external to the system and interact with the system by providing stimuli. Actors can be humans playing roles or even other systems. Use cases provide a framework to textual describe the behavior of the system: the inputs and outputs to actors; nature of the stimulus, etc. Example: Use Case: Looking up a web service
To understand the textual and graphical format of Use Cases refer to the reading. Important points:
Use cases are powerful tools for analysts to use when partitioning the functionality of a system. Use case relationships and the corresponding diagrams help analysts to structure use cases such that their textual descriptions contain a minimum of redundant information; thus making the whole text document much easier to maintain. But use cases are not design tools. They do not specify the structure of the eventual software, nor do they imply the existence of any classes or objects. They are purely functional descriptions written in a formalism that is completely separate from software design. |
|
| Sequence and Collaboration diagrams | |
| Download Interation Diagram reference material | |
| ZIP file containing 2 PDF files |
|
| Sequence and Collaboration diagrams are dynamic diagrams. They are commonly refered as Interaction diagrams. They both describe the flow of messages within a system. However, sequence diagrams focus on the order in which the messages are sent. They are very useful for describing the procedural flow through many objects. They are also quite useful for finding race conditions in concurrent systems. Collaboration diagrams on the other hand focus on the relationships between objects. They are very useful for visualizing the way several objects collaborate to get a job done and for comparing a dynamic model with a static model. | |
| Class diagrams | |
| State chart diagrams | |
| Download state chart reference material | |
| Microsoft Powerpoint |
|
|
Definitions Statechart diagram "A Statechart diagram depicts a finite state machine that describes how the class responds to different external stimuli (events). These stimuli are the receipt of messages by instances of the class, in the form of calls of the class’s operations" Object state An object has many states right from its creation to its destruction. Object transition A transition is a mechanism that causes an object to leave a state and change into a new state. Internal transition It is a special kind of transition that does not cause an object to leave the state. Statechart example - describing the borrowing of a book
Relationship between class and state The purpose of a state chart diagram is to describe the internal workings of objects. Each class has its own unique state chart diagram. Each object is an instance of a class and has a life cycle from its creation to destruction. During the existence of an object in a system, the object makes transitions from state to state. States are represented as attributes on the class diagram. However, note that the state of an object does not necessarily change whenever an attribute changes its value. When to use State Charts
|
|
| Design Patterns | |
|
Creational Patterns Allow objects to be created in a system without having to specify the class type in the code so you do not need to write large complex code to create objects.
Allows you to create systems without rewriting or customizing code. Provides a way to create highly reusable and robust systems.
Influence have state and behavior flow through a system. By optimizing how state and behavior flow you can organize, simplify and increase the maintainability of the system.
|
|
| Other Patterns | |
| Chain Reaction Pattern | This pattern allows the ability to create a group of chained tasks, and perform them in any order, parallel and independent of each other in a managed environment. |
| Singleton Pattern with Lazy Instantiation and Double Check Idiom |
This pattern addresses the need of a system that only needs to create a single instance of certain classes (e.g. class used for logging or db acccess). The Singleton pattern provides a way to do this. public class Loner() { private Loner(); private static Loner lone = new Loner(); public static Loner getInstance() { return lone; } // other public methods } |
| Multiple Polymorphism / Lazy Instatiation | This tip lists an example that leverages multiple polymorphism. The challenge is the use this concept to do away with any if / else or switch (conditional) statements |
| Continuous Integration Pattern |
Reduce project risk considerably by integrating often Several software projects are built by a large group of practitioners leading to division of work. At some point integration of all pieces needs to be done. This part of the project normally has the most risk attached to it due to the following reasons:
|
| Inversion of Control / Dependency Injection Pattern | This patterns is based on the statement "Don't call me I will call you". By using this pattern architects are inverting some aspect of control ensuring that a user of a component follows some convention that allows a separate component module to inject the implementation to the listener. |