Timeline for Use of the composite pattern
Current License: CC BY-SA 3.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 10, 2014 at 10:32 | vote | accept | Koen | ||
Jan 10, 2014 at 10:32 | comment | added | Koen | Ok. Thx for the info. | |
Jan 10, 2014 at 10:13 | comment | added | Sergey Berezovskiy |
@Koen yes, you can. All client should know about TestPlan or TestSequence is that it is runnable. You can create base class CompositeTest which will provide collection for storing child tests and method Run() which runs all children (as above). In that case restriction of children types goes to builder and interface of composite (e.g. TestPlan can have only method Add (TestSequence sequence) . If you don't need base composite class, then each composite can hold collection of specific children (i.e. TestSequece list for TestPlan )
|
|
Jan 10, 2014 at 9:49 | comment | added | Koen |
This makes sence. One more question though: is there a way to enforce that TestPlan can only contain TestSequence as child (and so on)? Or is that something I can take care of in my Builder.
|
|
Jan 10, 2014 at 9:18 | history | edited | Sergey Berezovskiy | CC BY-SA 3.0 |
added 27 characters in body
|
Jan 10, 2014 at 8:59 | history | edited | Sergey Berezovskiy | CC BY-SA 3.0 |
added 293 characters in body
|
Jan 10, 2014 at 8:50 | history | edited | Sergey Berezovskiy | CC BY-SA 3.0 |
added 847 characters in body
|
Jan 10, 2014 at 8:42 | history | answered | Sergey Berezovskiy | CC BY-SA 3.0 |