Skip to content

Commit

Permalink
Initial Spike
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeminutillo committed Jul 18, 2014
0 parents commit b0c1489
Show file tree
Hide file tree
Showing 33 changed files with 1,219 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .gitignore
@@ -0,0 +1,68 @@
#OS junk files
[Tt]humbs.db
*.DS_Store

#Visual Studio files
*.[Oo]bj
*.user
*.aps
*.pch
*.vspscc
*.vssscc
*_i.c
*_p.c
*.ncb
*.suo
*.tlb
*.tlh
*.bak
*.[Cc]ache
*.ilk
*.log
*.lib
*.sbr
*.sdf
*.opensdf
*.unsuccessfulbuild
ipch/
[Oo]bj/
[Bb]in
[Dd]ebug*/
[Rr]elease*/
Ankh.NoLoad

#MonoDevelop
*.pidb
*.userprefs

#Tooling
_ReSharper*/
*.resharper
[Tt]est[Rr]esult*
*.sass-cache

#Project files
[Bb]uild/

#Subversion files
.svn

# Office Temp Files
~$*

# vim Temp Files
*~

#NuGet
packages/
*.nupkg

#ncrunch
*ncrunch*
*crunch*.local.xml

# visual studio database projects
*.dbmdl

#Test files
*.testsettings
22 changes: 22 additions & 0 deletions ArchitectureScript.sln
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArchitectureScript", "ArchitectureScript\ArchitectureScript.csproj", "{07EDBD84-B267-4995-A8F6-D7B8D6BF100D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{07EDBD84-B267-4995-A8F6-D7B8D6BF100D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{07EDBD84-B267-4995-A8F6-D7B8D6BF100D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{07EDBD84-B267-4995-A8F6-D7B8D6BF100D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{07EDBD84-B267-4995-A8F6-D7B8D6BF100D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
6 changes: 6 additions & 0 deletions ArchitectureScript/App.config
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>
89 changes: 89 additions & 0 deletions ArchitectureScript/ArchitectureScript.csproj
@@ -0,0 +1,89 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{07EDBD84-B267-4995-A8F6-D7B8D6BF100D}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ArchitectureScript</RootNamespace>
<AssemblyName>ArchitectureScript</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Newtonsoft.Json.6.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Model\Component.cs" />
<Compile Include="Model\ComponentView.cs" />
<Compile Include="Parsing\ComponentSegmentWalker.cs" />
<Compile Include="Parsing\ComponentViewSegmentWalker.cs" />
<Compile Include="Parsing\ContainerSegmentWalker.cs" />
<Compile Include="Parsing\ElementSegmentWalker.cs" />
<Compile Include="Parsing\ISegmentWalker.cs" />
<Compile Include="Model\Container.cs" />
<Compile Include="Model\ContainerView.cs" />
<Compile Include="Model\ContextView.cs" />
<Compile Include="Model\Element.cs" />
<Compile Include="Model\ElementView.cs" />
<Compile Include="Model\Model.cs" />
<Compile Include="Model\Person.cs" />
<Compile Include="Model\Relationship.cs" />
<Compile Include="Model\RelationshipView.cs" />
<Compile Include="Model\SoftwareSystem.cs" />
<Compile Include="Model\View.cs" />
<Compile Include="Parsing\ModelSegmentWalker.cs" />
<Compile Include="Parsing\ParseAttribute.cs" />
<Compile Include="Parsing\Parser.cs" />
<Compile Include="Parsing\PersonSegmentWalker.cs" />
<Compile Include="Parsing\RelationshipSegmentWalker.cs" />
<Compile Include="Parsing\SystemSegmentWalker.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Parsing\Segment.cs" />
<Compile Include="Parsing\SegmentWalkerBase.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
16 changes: 16 additions & 0 deletions ArchitectureScript/Model/Component.cs
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ArchitectureScript.Model
{
public class Component : Element
{
public string Type { get { return "Component"; } }
public string Technology { get; set; }
public string ImplementationType { get; set; }
public string InterfaceType { get; set; }
}
}
37 changes: 37 additions & 0 deletions ArchitectureScript/Model/ComponentView.cs
@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ArchitectureScript.Model
{
public class ComponentView : View
{
private readonly Container _container;

public ComponentView(Container container) : base(container.Parent)
{
_container = container;
Name = String.Format("{0} - {1} - Components", container.Parent.Name, _container.Name);
}


public int ContainerId { get { return _container.Id; } }
public string Type { get { return "Component"; } }

public override void Normalize()
{
foreach (var system in Model.SoftwareSystems.Where(x => x.Id != SoftwareSystemId))
AddElement(system);

foreach (var container in System.Containers.Where(x => x.Id != _container.Id))
AddElement(container);

foreach(var component in _container.Components)
AddElement(component);

base.Normalize();
}
}
}
32 changes: 32 additions & 0 deletions ArchitectureScript/Model/Container.cs
@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ArchitectureScript.Model
{
public class Container : Element
{
private readonly IList<Component> _components = new List<Component>();

public string Technology { get; set; }
public string Type { get { return "Container"; } }
public IEnumerable<Component> Components { get { return _components; } }

internal SoftwareSystem Parent { get; set; }

public Component AddComponent(string name)
{
var component = Model.AddComponent(name);
AddComponent(component);
return component;
}

public void AddComponent(Component component)
{
_components.Add(component);
component.Location = this.Location;
}
}
}
32 changes: 32 additions & 0 deletions ArchitectureScript/Model/ContainerView.cs
@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ArchitectureScript.Model
{
public class ContainerView : View
{
public ContainerView(SoftwareSystem system) : base(system)
{
Name = String.Format("{0} - Containers", system.Name);
}

public string Type { get { return "Container"; } }

public override void Normalize()
{
foreach (var system in Model.SoftwareSystems.Where(x => x.Id != SoftwareSystemId))
AddElement(system);

foreach (var person in Model.People)
AddElement(person);

foreach (var container in System.Containers)
AddElement(container);

base.Normalize();
}
}
}
26 changes: 26 additions & 0 deletions ArchitectureScript/Model/ContextView.cs
@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ArchitectureScript.Model
{
public class ContextView : View
{
public ContextView(SoftwareSystem system) : base(system) { }

public string Type { get { return "SystemContext"; } }

public override void Normalize()
{
foreach (var system in Model.SoftwareSystems)
AddElement(system);

foreach (var person in Model.People)
AddElement(person);

base.Normalize();
}
}
}
47 changes: 47 additions & 0 deletions ArchitectureScript/Model/Element.cs
@@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ArchitectureScript.Model
{
public abstract class Element
{
public Model Model { get; set; }
public int Id { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public string Location { get; set; }

private readonly IList<Relationship> _relationships = new List<Relationship>();

public Relationship AddRelationship(string destination, string description)
{
var relationship = new Relationship();
relationship.Source = this;
relationship.DestinationTag = destination;
relationship.Description = description;
_relationships.Add(relationship);
return relationship;
}

public void Normalise()
{
foreach (var relationship in _relationships)
{
relationship.Destination = Model.GetElementByName(relationship.DestinationTag);
}
}

public IEnumerable<Relationship> Relationships
{
get { return _relationships; }
}

public bool ShouldSerializeModel()
{
return false;
}
}
}

0 comments on commit b0c1489

Please sign in to comment.