 |


Exercise 3: is_a and has_aJuly 29, 2008
Summary  | Implement an IsA function for the Entity class which will perform a depth-first search on is_a relationships to determine whether an entity has a direct or indirect is_a relationship with another entity. |
  | Implement a HasA function for the Entity class which will perform a depth-first search on the is_a relationship followed by a depth of one search of has_a. |
  | Throw an exception from Entity.Get as well as Entity.Set if the requested property does not exist. |
Test case: Click hereSolutionClick here Exercise 2: Entities, Relationships, and ValuesJuly 27, 2008
Summary  | Design an Entity class |
 |   | Implement Set method which allows a property of an entity to be given a value. For the time being, implement words as entities whos IDs are surrounded by single quotes. ex. 'Daniel' |
 |   | Implement a Get method which returns the value of a entity's property |
 |   | Implement an AddRelationship method |
  | Design a Relationship class as a subclass of Entity |
  | Design a Brain class which allows entities to be created via CreateEntity and relationships to be created using CreateEntity. Make the Entity and Relationship classes internal to this class and expose their functionality with the interfaces IEntity and IRelationship. |
 |   | Enforce entity IDs, if specified, to be unique. |
  | Pass the following test case: |
 | [Test] public void Test1() { IEntity is_a = Brain.CreateEntity("is_a"); IEntity has_a = Brain.CreateEntity("has_a");
IEntity Daniel = Brain.CreateEntity("Daniel"); IEntity person = Brain.CreateEntity("person"); Brain.CreateRelationship(Daniel, is_a, person); IEntity first_name = Brain.CreateEntity("first_name"); Brain.CreateRelationship(person, has_a, first_name); IEntity wDaniel = Brain.CreateEntity("'Daniel'"); Daniel.Set(first_name, wDaniel);
Assert.AreEqual("'Daniel'", Daniel.Get(first_name).Id); }} |
|
| SolutionClick here Exercise 1: Publishing an ASP.NET websiteJuly 27, 2008
SummaryCreate an ASP.NET website with Visual Studio and publish it to the web. Solution  | Unfortunately, netfirms.ca would charge me an extra $10/month for ASP.NET hosting | older >>
|
|
|
|
|
 |