jeudi 19 janvier 2017

Design Patterns C#

I need to turn this code into some sort of structured pattern. Please advise on how I can can make it structured.

class CLIV:SomeService
{
    public CLIV(): base
        ("Hi I am CLIV") { }

}
class SomeTransction
{
    public string transName { get; set; }
    public SomeTransction(string transConstructor)
    {
        transName = transConstructor;
    }
}
class SomeService
{
    public SomeTransction transaction { get; set; }
    public SomeService(string transName)
    {
        transaction = new SomeTransction(transName);   
    }
}
class Program
{
    public static string  AssignTransactionToPassedObject(CLIV clivobject)
    {
        CLIV cliobject = new CLIV();
        string getObject = cliobject.transaction.transName;
        return getObject;

    }
    static void Main(string[] args)
    {
        CLIV clivObject = new CLIV();
        Console.WriteLine(AssignTransactionToPassedObject(clivObject));
        Console.ReadKey();
    }

Aucun commentaire:

Enregistrer un commentaire