forked from ramram43210/Java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProject.java
More file actions
80 lines (64 loc) · 1.76 KB
/
Copy pathProject.java
File metadata and controls
80 lines (64 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// This is like Context
public class Project implements ProjectState
{
private ProjectState projectState;
public Project()
{
projectState = new RequirementGatheringState();
}
public ProjectState getProjectState()
{
return projectState;
}
public void setProjectState( ProjectState projectState )
{
this.projectState = projectState;
}
@Override
public void doRequirmentGathering()
{
projectState.doRequirmentGathering();
/*
* Once RequirmentGathering is finished project internal state
* will be moved to DesignAndArchitectureState
*/
if( projectState instanceof RequirementGatheringState )
{
setProjectState(new DesignAndArchitectureState());
System.out.println("\nProject internal state moved to : " + projectState.getClass().getName() +"\n" );
}
}
@Override
public void doDesignAndArchitecture()
{
projectState.doDesignAndArchitecture();
/*
* Once DesignAndArchitecture is finished project internal state
* will be moved to DevelopementState
*/
if( projectState instanceof DesignAndArchitectureState )
{
setProjectState(new DevelopementState());
System.out.println("\nProject internal state moved to : " + projectState.getClass().getName() +"\n" );
}
}
@Override
public void doDevelopement()
{
projectState.doDevelopement();
/*
* Once Developement is finished project internal state will be
* moved to TestingState
*/
if( projectState instanceof DevelopementState )
{
setProjectState(new TestingState());
System.out.println("\nProject internal state moved to : " + projectState.getClass().getName() +"\n" );
}
}
@Override
public void doTesting()
{
projectState.doTesting();
}
}