473,387 Members | 1,890 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Class design help

Hi

I am looking at implementing a Facade architecture in my system. i.e
MyBusinessFacdeSystem and multiple MyBusinessObjects
I want the MyBusinssObject class to only be created by the
MyBusinessFacdeSystem class.
i.e
using System;

namespace FacadeTest.MyFacade
{
/// <summary>
/// Summary description for MyFacadeSystem.
/// </summary>
public class MyFacadeSystem
{
private MyBusinessObject_MyBusinessObject = null;

public MyFacadeSystem()
{
_MyBusinessObject= new MyBusinessObject();
}

public MyBusinessObjects MyBusinessObjectsBLL
{
get
{
return _MyBusinessObjects;
}
}

}
}

How do I set the accessability if the MyBusinessObject class i.e.:
using System;

namespace FacadeTest.MyFacade
{
/// <summary>
/// Summary description for MyBusinessObject .
/// </summary>
internal class MyBusinessObject
{
public MyBusinessObject ()
{
}

public string SomeMethod(){
return "Hello";

}
}
}


Hope that is clear,

S
Nov 15 '05 #1
2 1074
Hi Sam

Everything you had was correct except for the modifier for the constructor
for MyBusinessObject. You need to make the modifier Internal so only your
facade can create it. To really ensure only the facade is creating it then
you could also pass in a parameter to the construtor or test the caller :)

Mark

"SamIAm" <sa****@rubbachicken.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
Hi

I am looking at implementing a Facade architecture in my system. i.e
MyBusinessFacdeSystem and multiple MyBusinessObjects
I want the MyBusinssObject class to only be created by the
MyBusinessFacdeSystem class.
i.e
using System;

namespace FacadeTest.MyFacade
{
/// <summary>
/// Summary description for MyFacadeSystem.
/// </summary>
public class MyFacadeSystem
{
private MyBusinessObject_MyBusinessObject = null;

public MyFacadeSystem()
{
_MyBusinessObject= new MyBusinessObject();
}

public MyBusinessObjects MyBusinessObjectsBLL
{
get
{
return _MyBusinessObjects;
}
}

}
}

How do I set the accessability if the MyBusinessObject class i.e.:
using System;

namespace FacadeTest.MyFacade
{
/// <summary>
/// Summary description for MyBusinessObject .
/// </summary>
internal class MyBusinessObject
{
public MyBusinessObject ()
{
}

public string SomeMethod(){
return "Hello";

}
}
}


Hope that is clear,

S

Nov 15 '05 #2
Mark

Thanks for the reply. What should I set the modifier to? I have set it to
internal, is that ok?

Thanks again,

S
"Mark" <f1*****@hotmail.com> wrote in message
news:Oh**************@TK2MSFTNGP10.phx.gbl...
Hi Sam

Everything you had was correct except for the modifier for the constructor
for MyBusinessObject. You need to make the modifier Internal so only your
facade can create it. To really ensure only the facade is creating it then you could also pass in a parameter to the construtor or test the caller :)

Mark

"SamIAm" <sa****@rubbachicken.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
Hi

I am looking at implementing a Facade architecture in my system. i.e
MyBusinessFacdeSystem and multiple MyBusinessObjects
I want the MyBusinssObject class to only be created by the
MyBusinessFacdeSystem class.
i.e
using System;

namespace FacadeTest.MyFacade
{
/// <summary>
/// Summary description for MyFacadeSystem.
/// </summary>
public class MyFacadeSystem
{
private MyBusinessObject_MyBusinessObject = null;

public MyFacadeSystem()
{
_MyBusinessObject= new MyBusinessObject();
}

public MyBusinessObjects MyBusinessObjectsBLL
{
get
{
return _MyBusinessObjects;
}
}

}
}

How do I set the accessability if the MyBusinessObject class i.e.:
using System;

namespace FacadeTest.MyFacade
{
/// <summary>
/// Summary description for MyBusinessObject .
/// </summary>
internal class MyBusinessObject
{
public MyBusinessObject ()
{
}

public string SomeMethod(){
return "Hello";

}
}
}


Hope that is clear,

S


Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

50
by: Dan Perl | last post by:
There is something with initializing mutable class attributes that I am struggling with. I'll use an example to explain: class Father: attr1=None # this is OK attr2= # this is wrong...
13
by: Bryan Parkoff | last post by:
I have created three classes according to my own design. First class is called CMain. It is the Top Class. Second class and third class are called CMemory and CMPU. They are the sub-classes....
3
by: fernandez.dan | last post by:
I'm still learning how to use Object Oriented concepts. I'm have a basic question dealing with design. I have two classes that deal with I/O pertaining to network and usb that inherit from an...
9
by: Sacha | last post by:
I work on a rather large C++ project. The design, so far, seems to be fine. However, there is one class, where the number of methods (and less dramtically the number of members, too) is growing and...
6
by: JSheble | last post by:
I come from a Delphi background, and am currently trying to port or convert some of our Delphi classes to C#. I've got a good handle on basic class design, but am a bit lost with some of the more...
6
by: rodchar | last post by:
Hey all, I'm trying to understand Master/Detail concepts in VB.NET. If I do a data adapter fill for both customer and orders from Northwind where should that dataset live? What client is...
9
by: David A. Osborn | last post by:
I have a set of classes that each have an enumeration in them, and based on dynamic input I need to access a different enumeration. For example Three classes Class_A, Class_B, and Class_C that...
7
by: WXS | last post by:
Vote for this idea if you like it here: http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=5fee280d-085e-4fe2-af35-254fbbe96ee9...
4
by: alacrite | last post by:
I have a class that I want to turn its contents into csv file. I want to be able to set the value of the delimiter, the name of the file it gets saved to, the path of that file, and maybe a few...
6
by: Bhawna | last post by:
I am into c++ code maintenance for last 3-4 years but recently I am put into design phase of a new project. Being a small comapany I dont have enough guidance from seniors. Currently I am into a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.