与子树对应的节点有特定的名称吗?

发布于 2024-07-04 09:44:38 字数 347 浏览 10 评论 0原文

我正在设计一个网站导航层次结构。 它是一棵节点树。 节点代表网页。

树上的一些节点是特殊的。 我需要给他们起一个名字。

有多个这样的节点。 每个都是子树的“根”,子树的页面具有不同的徽标、样式表或布局。 考虑不同的部门。

带有颜色编码子树的站点地图 http://img518.imageshack.us/img518 /153/subtreesfe1.gif

我应该为这种类型的节点命名什么?

I'm designing a web site navigation hierarchy. It's a tree of nodes. Nodes represent web pages.

Some nodes on the tree are special. I need a name for them.

There are multiple such nodes. Each is the "root" of a sub-tree with pages that have a distinct logo, style sheet, or layout. Think of different departments.

site map with color-coded sub-trees http://img518.imageshack.us/img518/153/subtreesfe1.gif

What should I name this type of node?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

孤城病女 2024-07-11 09:44:38

您要查找的词是“部分”。 它是一个整体的一部分,里面有相同的东西。

所以,你有节点,它有子节点和父节点,还有部分节点,它们是这些特殊子树的根。

The word you are looking for is "Section". It's part of a whole and has the same stuff inside.

So, you have Nodes, which have children and a parent, and you have SectionNodes which are the roots of these special subtrees.

染火枫林 2024-07-11 09:44:38

PageTemplate 能否体现其子级拥有自己的布局、CSS 等这一事实?

How about PageTemplate to embody the fact that its children have their own layout, CSS etc?

爱的十字路口 2024-07-11 09:44:38

区域节点

AreaNode

野生奥特曼 2024-07-11 09:44:38

所以,听起来你正在收集类别。 节点是该类别的入口点。 那么“TopCategoryNode”、“CategoryEntry”怎么样,然后是它们下面的一些东西。 或者,如果你想划分更多,比如“CategoryCSS”、“CategoryLayout”等?

这是一种通用的,但您明确指出存在“类别”,并且这些类别确实包含多个子节点或子主题。

So, it sounds like you are gathering categories. The nodes are the entry points of this categories. How about "TopCategoryNode", "CategoryEntry" then for som,ething that is below them. Or, if you want to divide more, something like "CategoryCSS", "CategoryLayout" etc?

This is kind of generic, but you make clear that there are "categories", and that these do consist of more than one subnode, or subtheme.

秋心╮凉 2024-07-11 09:44:38

分支 ?

保持树的类比,并在这种情况下暗示部门等

考虑类层次结构,根可能是分支的特例,这是节点的特例,叶的特例。 分支/节点的区别是您可以根据自己的特殊情况进行的区别。

Branch ?

Keeps the tree analogy and also hints in this case at departments etc

Thinking about class heirarchies, Root is probably a special case of Branch, which is a special case of Node, special case of Leaf. The Branch/Node distinction is one you get to make for your special situation.

筑梦 2024-07-11 09:44:38

根(有子节点,但没有父节点)、节点(有子节点和父节点)和叶(没有子节点和父节点)怎么样?

然后,如果需要,您可以通过树结构中的名称和位置(例如 DepartmentRoot、DepartmentNode、DepartmentLeaf)进行区分。

更新来自 OP 的评论

查看您的问题,您说“某些”是特殊的,在您的图表中,您不同的节点在不同的层次上有不同的看法。 节点的设计可能不同,您可以通过多种方式构建树结构。 例如,一个抽象类可以有子节点,如果没有子节点,则它是叶子,如果没有父节点,则它是根,但这可以在其生命周期内改变。 或者,一个固定的类结构,其中叶子是一种特定的类类型,不能以任何方式向其添加子级。

如果您的设计不需要根据节点的位置(相对于根)来区分节点,则表明您有一个用于所有节点的抽象类。

在这种情况下,它提出了一个问题,它有什么不同?

如果它与其他地方的标准节点简单相同,但有一些样式,那么StyledNode? 你甚至需要它是单独的(没有样式==没什么大不了的,它不会渲染)。

由于我不知道树的架构机制,因此命名时可能需要考虑几个因素。

How about Root (node with children, but no parent), Node (node with children and parent) and Leaf (node with no children and parent)?

You can then distinguish by name and position within the tree structure (E.g. DepartmentRoot, DepartmentNode, DepartmentLeaf) if need be..

Update Following Comment from OP

Looking at your question, you said that "some" are special, and in your diagram, you have different nodes looking differently at different levels. The nodes may be different in their design, you can build a tree structure many ways. For example, a single abstract class that can have child nodes, if no children, its a leaf, if no parent, its a root but this can change in its lifetime. Or, a fixed class structure in which leafs are a specific class type that cannot have children added to them in any way.

IF your design does not need you to distinguish nodes differently depending on their position (relative to the root) it suggests that you have an abstract class used for them all.

In which case, it raises the question, how is it different?

If it is simply the same as the standard node everywhere else, but with a bit of styling, how about StyledNode? Do you even need it to be seperate (no style == no big deal, it doesn't render).

Since I don't know the mechanics of how the tree is architected, there could possibly be several factors to consider when naming.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文