Have a look at protected constructors, factory classes etc. On Mon, Mar 8, 2010 at 6:10 PM, crazy <[email protected]> wrote:
> ok.. then how can i create a class which will not allow to create objects > itself and another class allowing it to create object. > If possible,I would like to know the class architeture using in .net behind > this concept... > ( I am doing some R&D in .Net class architecture) > > Thanks > Vipin > > On Mon, Mar 8, 2010 at 3:04 PM, Jamie Fraser <[email protected]>wrote: > >> Think of the DataTable in this case as being a pseudo-factory that is >> responsible for creating DataRows. >> >> In a semantic sense, a datarow MUST have an associated table (to begin >> with) - a row cannot exist without a table. >> >> >> On Fri, Mar 5, 2010 at 9:00 PM, crazy <[email protected]> wrote: >> >>> hi All, >>> >>> DataTable oDT=new DataTable(); >>> >>> DataRowoDR=null; >>> >>> Case 1: >>> oDR=new DataRow() ; >>> >>> Case 2: >>> oDR=new oDT.DataRow(); >>> >>> >>> why Case 1 showing error? >>> .Net doesnt allowing to create a object to that DataRow() class.But it >>> allowing DataTable to create a object to DataRow(). >>> If so , what type of class is DataRow()? >>> >>> One scenario is there, if DataRow() class contains only private >>> Constructor s and it contains a public static method which will create a new >>> row . But in Datarow ,using Wincv I have checked available public methods , >>> but i cant able to find such a public static method in DataRow(). >>> >>> Then what type of architecture using in DataRow() ? >>> >>> >>> >>> >>> -- >>> "People who never make mistakes, never do anything." >>> >>> dEv >>> >> >> > > > -- > "People who never make mistakes, never do anything." > > dEv >
