Benj Nunez
unread,Dec 17, 2008, 9:52:38 PM12/17/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
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