Skip to content

Commit

Permalink
Tarea: UML Class Diagram Relationships
Browse files Browse the repository at this point in the history
Falta agregar los Diagramas al folder (los tengo en OSX)
  • Loading branch information
Omfe committed Oct 13, 2013
1 parent 22984db commit b92ace3
Show file tree
Hide file tree
Showing 11 changed files with 283 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Express 2012 for Windows Desktop
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UMLClassDiagram", "Association\UMLClassDiagram.csproj", "{A663B49E-02C7-4718-B780-1A04D43F42AA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A663B49E-02C7-4718-B780-1A04D43F42AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A663B49E-02C7-4718-B780-1A04D43F42AA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A663B49E-02C7-4718-B780-1A04D43F42AA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A663B49E-02C7-4718-B780-1A04D43F42AA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Association
{
public class Aficionado
{
public string equipo { get; set; }

public void AsistirAEstadio(Estadio obj)
{
Console.Write("Aficionado: Creo que ire al estadio un ratillo\n");
obj.aficionadosAdentro++;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Association
{
public class Estadio
{
public int aficionadosAdentro { get; set; }

public void Invitar(Aficionado obj)
{
Console.Write("Estadio Parlante: Porfavor ven!\n");
}

public void Destruir(Gradas obj, Estadio estadio)
{
Console.Write("Estadio hico Selfdestruct: Destruyeron todo de todo\n");
obj.existentes = false;
estadio = null;
}

public void ContarAficionados()
{
Console.Write("Hay {0} aficionados adentro\n", aficionadosAdentro.ToString());
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Association
{
public class Gradas
{
public bool existentes { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Association
{
class HijaAficionado : Aficionado
{

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Association
{
class HijoAficionado : Aficionado
{

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Association
{
class Program
{
static void Main(string[] args)
{
//Association!

Estadio objEstadio = new Estadio();
Aficionado objAficionado = new Aficionado();

objEstadio.Invitar(objAficionado);
objAficionado.AsistirAEstadio(objEstadio);

//Agregation!
VendedorPizza objVendedorPizza = new VendedorPizza();

objVendedorPizza.venderPizza(objEstadio);

//Dependecy!
objEstadio.ContarAficionados();

//Generalization!
HijaAficionado objHijaAficionado = new HijaAficionado();
HijoAficionado objHijoAficionado = new HijoAficionado();

objAficionado.equipo = "Xolos";
objHijaAficionado.equipo = "Real Madrid...";
objHijoAficionado.equipo = "Barcelona, el mejor equipo de la historia!";

Console.Write("El papa es aficionado de {0}, la hija de {1} y el hijo de {2}\n", objAficionado.equipo, objHijaAficionado.equipo, objHijoAficionado.equipo);

//Composition!

Gradas objGradas = new Gradas();
objGradas.existentes = true;

objEstadio.Destruir(objGradas, objEstadio);
if (objGradas.existentes == false)
{
Console.Write("Tambien murieron las gradas");
}

Console.ReadLine();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Association")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Association")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("57c3ce6c-7817-46f6-b379-a70c570a2f2a")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.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>{A663B49E-02C7-4718-B780-1A04D43F42AA}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Association</RootNamespace>
<AssemblyName>Association</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="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="Aficionado.cs" />
<Compile Include="Estadio.cs" />
<Compile Include="Gradas.cs" />
<Compile Include="HijaAficionado.cs" />
<Compile Include="HijoAficionado.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="VendedorPizza.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Association
{
public class VendedorPizza
{
public void venderPizza(Estadio obj)
{
Console.Write("Estoy vendiendo pizzas en este estadio\n");
}
}
}

0 comments on commit b92ace3

Please sign in to comment.