Skip to main content
added 2 characters in body
Source Link
Tulains Córdova
  • 39.6k
  • 13
  • 102
  • 157

One way to make it easier is that all classes implement the same interface so you can treat them indistinctly. Theres a known pattern for this:

enter image description here

The good newnews is that as this creates a tree, you. You can then write, in an external managing class, recursive methods to look up items.

For example you could write a method findAndAdd(String tagToFind, Component componentToAdd);

To the base interfaces doumenteddocumented in the pattern you should add a tagMatches(String tag) as well as all common getters and setters so you can, again, treat items indistincltly of their class.

I would add hasChild() and nextChild() methods to implement iterations.

One way to make it easier is that all classes implement the same interface so you can treat them indistinctly. Theres a known pattern for this:

enter image description here

The good new is that as this creates a tree, you can then write, in an external managing class, recursive methods to look up items.

For example you could write a method findAndAdd(String tagToFind, Component componentToAdd);

To the base interfaces doumented in the pattern you should add a tagMatches(String tag) as well as all common getters and setters so you can, again, treat items indistincltly of their class.

I would add hasChild() and nextChild() methods to implement iterations.

One way to make it easier is that all classes implement the same interface so you can treat them indistinctly. Theres a known pattern for this:

enter image description here

The good news is that as this creates a tree. You can then write, in an external managing class, recursive methods to look up items.

For example you could write a method findAndAdd(String tagToFind, Component componentToAdd);

To the base interfaces documented in the pattern you should add a tagMatches(String tag) as well as all common getters and setters so you can, again, treat items indistincltly of their class.

I would add hasChild() and nextChild() methods to implement iterations.

deleted 58 characters in body
Source Link
Robert Harvey
  • 200.7k
  • 55
  • 470
  • 683

One way to make it easier is that all classes implement the same interface so you can treat them indistinctly. Theres a known pattern for thisknown pattern for this:

enter image description here

The good new is that as this creates a tree, you can then write, in an external managing class, recursive methods to look up items.

For example you could write a method findAndAdd(String tagToFind, Component componentToAdd);

To the base interfaces doumented in the pattern you should add a tagMatches(String tag) as well as all common getters and setters so you can, again, treat items indistincltly of their class.

UPDATE:

The UML diagram is taken from here.

I would add hasChild() and nextChild() methods to implement iterations.

One way to make it easier is that all classes implement the same interface so you can treat them indistinctly. Theres a known pattern for this:

enter image description here

The good new is that as this creates a tree, you can then write, in an external managing class, recursive methods to look up items.

For example you could write a method findAndAdd(String tagToFind, Component componentToAdd);

To the base interfaces doumented in the pattern you should add a tagMatches(String tag) as well as all common getters and setters so you can, again, treat items indistincltly of their class.

UPDATE:

The UML diagram is taken from here.

I would add hasChild() and nextChild() methods to implement iterations.

One way to make it easier is that all classes implement the same interface so you can treat them indistinctly. Theres a known pattern for this:

enter image description here

The good new is that as this creates a tree, you can then write, in an external managing class, recursive methods to look up items.

For example you could write a method findAndAdd(String tagToFind, Component componentToAdd);

To the base interfaces doumented in the pattern you should add a tagMatches(String tag) as well as all common getters and setters so you can, again, treat items indistincltly of their class.

I would add hasChild() and nextChild() methods to implement iterations.

added 215 characters in body
Source Link
Tulains Córdova
  • 39.6k
  • 13
  • 102
  • 157

One way to make it easier is that all classes implement the same interface so you can treat them indistinctly. Theres a known pattern for this:

enter image description here

The good new is that as this creates a tree, you can then write, in an external managing class, recursive methods to look up items.

For example you could write a method findAndAdd(String tagToFind, Component componentToAdd);

To the base interfaces doumented in the pattern you should add a tagMatches(String tag) as well as all common getters and setters so you can, again, treat items indistincltly of their class.

UPDATE:

The UML diagram is taken from here.

I would add hasChild() and nextChild() methods to implement iterations.

One way to make it easier is that all classes implement the same interface so you can treat them indistinctly. Theres a known pattern for this:

enter image description here

The good new is that as this creates a tree, you can then write, in an external managing class, recursive methods to look up items.

For example you could write a method findAndAdd(String tagToFind, Component componentToAdd);

To the base interfaces doumented in the pattern you should add a tagMatches(String tag) as well as all common getters and setters so you can, again, treat items indistincltly of their class.

One way to make it easier is that all classes implement the same interface so you can treat them indistinctly. Theres a known pattern for this:

enter image description here

The good new is that as this creates a tree, you can then write, in an external managing class, recursive methods to look up items.

For example you could write a method findAndAdd(String tagToFind, Component componentToAdd);

To the base interfaces doumented in the pattern you should add a tagMatches(String tag) as well as all common getters and setters so you can, again, treat items indistincltly of their class.

UPDATE:

The UML diagram is taken from here.

I would add hasChild() and nextChild() methods to implement iterations.

added 435 characters in body
Source Link
Tulains Córdova
  • 39.6k
  • 13
  • 102
  • 157
Loading
Source Link
Tulains Córdova
  • 39.6k
  • 13
  • 102
  • 157
Loading