Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 13th, 2004, 03:52 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default OO Advise and Clarification

I am fairly new to .NET and OO.
My background is in ASP and VB6.

If I were to create a simple class called 'Person'.
Am I correct in using the constuctor to initialise an existing person and a static method to create a new person]

EG
Person p1 = new Person(personID)
This would then load all the instance variables from the db such as Name, DOB, etc.

But I would use a static method to create a new Person.
EG
Person p2;
p2 = Person.CreateNewPerson(Name,DOB,ETC)
This would insert a new person into the DB and return that person as a new person instance.

I am looking for any general advise on what I should do.
Could this be handled better another way?



======================================
They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================
__________________
======================================
"They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad."
--Shakespeare
======================================
 
Old October 14th, 2004, 09:51 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default

I guess someone would have mentioned if this was totally the wrong way to go about things?


======================================
They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================





Similar Threads
Thread Thread Starter Forum Replies Last Post
MENU AND OO pallone .NET Framework 2.0 0 September 25th, 2008 11:36 AM
Please have a look and advise on my join mat41 SQL Language 2 August 9th, 2005 06:22 PM
Problems with Java Mail Please advise "Chapter 9" PatrickWalsh JSP Basics 1 September 5th, 2004 06:46 PM
$ command not recognised.-Can you please advise PatrickWalsh JSP Basics 14 January 17th, 2004 09:56 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.