Hi!

Ironically, I am one of the Java Programmers here in our office but I
use C#  for one our clients! I practice the use of the
MVC (Model View Controller) pattern. I had to adjust the use of this
pattern a bit in C# since it's a different "environment"
altogether. :-)

I suggest you create some tiers for you apps. It goes like this:

TaskEntry - class that hold your getters and setters. Not really
needed. But if you want the "look and feel" of Java, I    suggest you
try this. :)
TaskEntryDao - the "interface" part of your app. Declaration of
methods.
TaskEntryDaoImpl - the class which holds/implements the definition of
your methods declared under TaskEntryDao.
TaskEntryService - class that instantiates and uses the
TaskEntryDaoImpl class.
TaskEntryForm - the gui part of your app (optional). Instantiates the
TaskEntryService and use the methods it exposes.

Optional:
StringHolder.cs - helper class that has getters and setters that help
display the contents of a collection
    in a visual control. It is similar to TaskEntry.

The reason why I have a stringHolder class is because I noticed that I
don't get to display the contents of
my collection to a visual control by using my user-defined xxxEntry
class.

The xxxEntry class goes like this (even in Java)

class MyClassEntry
{
  string Name;
  string Address;

  public void setName(string Name)
  {
     this.Name = Name;
  }

  public string getName()
  {
    return Name;
  }

  ...
}

StringHolder.cs Helper class will go like this:

class StringHolder
{
  private string shName;
  private string shAddress;

  public string shName
  {
    get
    {
        return Name;
    }
    set
    {
        Name = value;
    }
  }

  public StringHolder(string AName)
  {
    this.Name = AName;
  }

}


I have a sample utility app that uses this mvc-like pattern. If
interested, I'll be glad to email it to you.


Cheers!



Benj














On Dec 17, 6:03 pm, Sreenivas <[email protected]> wrote:
> Hi,
>      I have 3 classes namely ,
> 1)Task
> 2)Customer
> 3)Project
>
> and their DB classes are
> 1)DbTask
> 2)DbCustomer
> 3)DbProject
> respectively.Is it a good idea to interact Business logic classes
> (Task ,Customer,Project) with Db
> classes??
> I heard creating DAO for .net is old fashioned one ,
> (http://social.msdn.microsoft.com/forums/en-US/adodotnetdataproviders/
> thread/7d30fbe3-b06d-48b9-a2c1-125acd608445/)
> is it true?
> Thanks in advance..

Reply via email to