I am working on converting an app I wrote using J2EE to ASP.NET. In the java world we have JavaBeans which would consist of code like:
public class Person
{
private String name;
private int age;
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setAge(int age)
{
this.age = age;
}
public int getAge()
{
return age;
}
}
This technique is used to store various objects in the session or request and it makes it really easy to retrieve stored information. We also map these to database tables so in the above example I might have a table called Person with fields for name and age. When I pull the information out of the database, I just create the Person object and store them there. I can also put the Person object in a collection of some sort if I have more than one.
Is this type of practice similar to what is done when using ASP.NET? Is there a different methodology I should be following? If so, how are similar types of information passed around from page to page other than creating simple arrays and collections and putting them in the request or session?
Thanks.
Gregg