I found some reading materials about factory design pattern (parallel hierarchy) whereby a class in a hierarchy has a corresponding class in the another hierarchy. So I wrote the code as below: package com.factory3; public abstract class Subject { abstract SubjectPlanner createPlanner(); } package com.factory3; public class English extends Subject{ public SubjectPlanner createPlanner(){ return new EnglishPlanner(this); } } package com.factory3; public class Mathematic extends Subject{ public SubjectPlanner createPlanner(){ return new MathematicPlanner(this); } } package com.factory3; import java.util.Date; public abstract class SubjectPlanner { private Subject s; public SubjectPlanner(Subject s){ this.s = s; } public abstract Date getAvailable(); } package com.factory3; import …

Member Avatar
+0 forum 0

Im stuck in a mire of infinite child/parent relationships and trying to print out an organogram type tree. I have widgets with an id... a widget can have a parent widget and reference its id as the sub-widget's parent_id... now I need to print this out in a hierarchy, and all I have is an array with all of my widgets in it. If I try a foreach loop, I can say for array[0] - check through the other widgets and find those that reference array[0] as the parent, and print them out. But, if that second level widget also …

Member Avatar
Member Avatar
+0 forum 1

Hello. I want to use list of URLs in database and create a website hierarchy. The table only contains URLs as following: http://www.sample.com/ http://www.sample.com/post1/ http://www.sample.com/post2/ Then I would like to create a hierarchy looks like this: example1 | -------- | | post1 post2 My idea was to import the data (list of URLs) to a text file and use c# to create a hirarchy. However, I don't know how to do it. Could you please help me with this? Thank you very much for your time!

Member Avatar
Member Avatar
+0 forum 1

The application is currently developed using ASP.NET (C#) I have code to pull data from a SQL Server 2008 table and organize it into an hierarchy: [code=sql] With hierarchy (id, [location id], name, depth, trail) As ( -- selects the "root" level items. Select ID, [LocationID], Name, 1 As depth, [trail] = cast(Name + '/' as varchar(255)) From dbo.Locations Where ID = [LocationID] Union All -- selects the descendant items. Select child.id, child.[LocationID], child.name, parent.depth + 1 As depth, [trail] = cast(trail + child.name + '/' as varchar(255)) From dbo.Locations As child Inner Join hierarchy As parent On child.[LocationID] = …

Member Avatar
+0 forum 0

hi... I am using sorted dictionary to add nodes in a hierarchy but i have to show multi-parent multi-child relation but sorted dictionary doesn't allow duplicate entries :( is there any way if yes please suggest I will be honored Thanks in advance

Member Avatar
Member Avatar
+0 forum 2

Hey all I have to display organizational hierarchy or my company but it is quite hectic job... Can any one help me out. At this stage I am able to show for only upto 50 nodes but when I start adding nodes dynamically it gives out of bound exception can any one tell me an easy way or tool to do this. I have tried by generating dynamic labels for each employee but it not easy to handle and also gives a very untidy look please help me in this problem.. Any Tutorial or source code available on net will …

Member Avatar
Member Avatar
+0 forum 5

The End.