title: N-Layer Architecture in C#
body: <p>I'm trying to implement N-layer architecture to my project first time. </p>
  
  <p>I created BLL, DAL and GUI</p>
  
  <p>Here is in GUI</p>
  
  <pre><code>XmlSettingsBLL xmlSettings = new XmlSettingsBLL();
  
    var newDict = new NewDictionary()
    {
     StrDataSourceType = "AccessMdb",// DataSourceType.AccessMdb,
     DictionaryID = Guid.NewGuid().ToString(),
     FirstColumnName = "Kelime",
     SecondColumnName = "Karsilik",
     TableName = "kelimelerpro",
     LastShowedID = 0,
     Name = "kpds",
     Path = "kelimeler.mdb"
    };
  
    xmlSettings.AddNewDictionary(newDict);
  </code></pre>
  
  <p>here is in BLL</p>
  
  <pre><code>public bool AddNewDictionary(NewDictionary list)
  {
  list.DatasourceType = (DataSourceType)Enum.Parse(typeof (DataSourceType), list.StrDataSourceType);
  
  IDictionaryList newDictionary =list;
  
  try
  {
     helper.AddDictionary(newDictionary);
     return true;
  }
  catch
  {
    return false;
  }      
  }
  
   public class NewDictionary : IDictionaryList
  {
      public string Name { get; set; }
      public string Path { get; set; }
      public string DictionaryID { get; set; }
      public string TableName { get; set; }
      public int LastShowedID { get; set; }
      public string FirstColumnName { get; set; }
      public string SecondColumnName { get; set; }
      public DataSourceType DatasourceType { get; set; }
      public string StrDataSourceType { get; set; }  
  }
  </code></pre>
  
  <p>and here is in DAL</p>
  
  <pre><code> public void AddDictionary(IDictionaryList list)
   {
     var channelElem = xdoc.Element("MemorizeSettings");
     var dictionaries = channelElem.Element("Dictionaries"); 
  
     XAttribute[] attrs = new XAttribute[8];
     attrs[0] = new XAttribute("Name", list.Name);
     attrs[1] = new XAttribute("Path", list.Path);
     attrs[2] = new XAttribute("TableName", list.TableName);
     attrs[3] = new XAttribute("DatasourceType", Enum.GetName(typeof(DataSourceType),list.DatasourceType));
     attrs[4] = new XAttribute("LastShowedID", "0");
     attrs[5] = new XAttribute("FirstColumnName", list.FirstColumnName);
     attrs[6] = new XAttribute("SecondColumnName", list.SecondColumnName);
     attrs[7] = new XAttribute("DictionaryID", list.DictionaryID);
  
     var newdict = new XElement("Dictionary", attrs);
  
     dictionaries.Add(newdict);
     xdoc.Save(fileName);
   }
  
  public interface IDictionaryList
  {
       string Name { get; set; }
       string Path { get; set; }
       string DictionaryID { get; set; }
       string TableName { get; set; }
       int LastShowedID { get; set; }
       string FirstColumnName { get; set; }
       string SecondColumnName { get; set; }
       DataSourceType DatasourceType { get; set; }
  }
  </code></pre>
  
  <p>so, in GUI, naturally it needs to add DAL as reference because I derived NewDictionary  from IDictionary that is in DAL. But I want to seperare GUI and DAL each other. </p>
  
  <p>apart from creating an IDictionary object, how can I do it?
  I hope the question is clear</p>