Architecture :: Key, Value Pairs Implementation In Class?

Feb 16, 2010

In a project im working on there are many sql tables containing different ID, Name pairs. Those are represented as Enums in classes that need them however that requires casting since tables contain ID only.Also when serialize the Enum contains the ID not value.

View 3 Replies

Similar Messages:

Architecture :: Function Implementation In 3-tier Architecture?

Apr 28, 2010

I have implemented the 3-tier architecture project; DAL, BAL, and presentation layer are three layers in it. I am going to implement the following scenario:

Presentation layer calls to a function in the BAL layer which returns 2 string variable, and in turn this function from BAL layer calls to a DAL layer function which also returns 2 string variable. How can I implement the above scenario?

View 2 Replies

Architecture :: A Proper DI Implementation?

Feb 27, 2011

I'm fairly new to dependency injection but it seems like a proper DI implementation will be fairly complex.

For example, DI requires a centralized class that manages the configuration and resolves the dependencies at runtime.

DI is also based on the concept of using interfaces. For example, a SpecialLogger should use an ILogger interface.

The centralized DI manager class will need to register types - for example, associate ILogger to SpecialLogger.

SpecialLogger will also need to implement the ILogger interface so SpecialLogger can be used through the DI ILogger interface.

Therefore, it seems like a sln using DI will need multiple projects to support DI. Here is an example for logging:

* MyCompany.MyDivision.Framework.DI.Management - this would have the DI manager where dependency types are registered and resolved at runtime
* MyCompany.MyDivision.Framework.Logging - this would have the implementation of a logging class. The main logging class would need to implement ILogger.
* MyCompany.MyDivision.Framework.DI.Interfaces - this would have the ILogger interface.

Interfaces would need to be stored in a separate class library from the DI manager because both the DI manager and SpecialLogger use the ILogger interface. Since the DI manager associates SpecialLogger to ILogger a circular reference would be encountered without a separate class library to store the ILogger interface.

View 1 Replies

C# - Proper Implementation Of N-layer Architecture?

Feb 28, 2011

I have been learning C# for the last year or so and trying to incorporate best practices along the way. Between StackOverflow and other web resources, I thought I was on the right track to properly separating my concerns, but now I am having some doubts and want to make sure I am going down the right path before I convert my entire website over to this new architecture.

The current website is old ASP VBscript and has a existing database that is pretty ugly (no foreign keys and such) so at least for the first version in .NET I do not want to use and have to learn any ORM tools at this time.

I have the following items that are in separate namespaces and setup so that the UI layer can only see the DTOs and Business layers, and the Data layer can only be seen from the Business layer. Here is a simple example:


Am I completely off base? Should I also have the same properties in my BLL and not pass back DTOs to my UI? what is wrong and what is right. Keep in mind I am not a expert yet.

I would like to implement interfaces to my architecture, but I am still learning how to do that.

View 4 Replies

Website Translation Architecture And Implementation?

Mar 18, 2011

I'm conducting a project in which a website should have multi-language support.Now, this website is supposed to serve about 500K+ visitors a day, so it must be super-efficient.

I've created a table of parameters {[ID],[Name]} AND a linkage-table {[objectID],[parameterID],[languageID],[value]}. I think it's the best way to deploy multi-language support while having the privilege to translate different parameters for each language.

As far as I know, server's memory is much faster than a physical HDD. Therefore, I'm planning to store ASP.NET Application State objects for my translation architecture.[URL]

View 3 Replies

Architecture :: Implementation Of User Authentication In C#?

Feb 15, 2011

I am working on a web application project with a layered architectural style having DAL, BLL, Service Layer and Presentation Layer. It's going to be a Web forms application.

My intent is to try using some of the new features of .Net 3.5 or 4.0.

Currently, I am thinking through different approaches for implementing Authentication in this project.

I have a query regarding the design of the application, particularly Authentication.

In which layer should I have Authentication class? BLL? If I implement the Authentication class in BLL, should I be having an app.config in the same class library project to contain the Database connection string and all.

View 7 Replies

Architecture :: Search Engine Implementation?

Jul 22, 2010

not sure if I'm posting to the right thread or not.. but here is the questiondoes anyone know how to implement a best pratice on SEO?One of the example is: if the user types "brand new canon camera" then I want the system to find a sequence of string in the database that contains "new", "cannon", "camera". It is ok with or without the word "brand". However if the user types "HP laptop DV1000" and i want the system to find all HP laptop whether new or not but limited to specific series.

View 3 Replies

Architecture :: What's The Advantages / Disadvantages Of Explicit Interface Implementation

Jul 19, 2010

I am searching for the advantages and disadvantages of the explicit interface implementation

View 1 Replies

Architecture :: Generic Comments Module (Database Design And Implementation)

Feb 10, 2010

I am in the process of redesigning our main product, a knowledge database system for clients to access clinical and specialist advice articles. There is a requirement to add "Social Networking" to this allowing users to connect and post remarks etc...

This is somewhat similar to the Facebook wall scenario - where Articles, Photos, Groups, Products, Events, ActivityFeed can all have comments. I am at a lose as to the database design I would need to implement this. All comments must allow for Moderation/Approval/Spam Reporting etc...

I originally thought a individual table for each Comments entity ex: ArticleComment, ProductComment would work as the comments themselves are not all directly related. Each table having the same exact columns. But this makes life abit awkward as then this creates a separation between something that for all purposes is the same i.e. They are all comments.

The other design idea was to have a single Comment table with an "arc" type relationship to related tables with FK references back to the source.

The other option was to have a single Comment table with an Object Type and XID but this breaks the rules of relation and does not all for referential integrity.

I am at a lose and don't know what to do. I have asked over at and all I have done is raised more questions than answers about what to do.

Design 1: This would require exact copies of this table for all the entities.

-- Photo Comments --
CREATE TABLE dbo.PhotoComment
CommentID int IDENTITY(1,1) NOT NULL,
PhotoID int NOT NULL,
Body ntext NOT NULL,
ReportedAsSpam bit NOT NULL CONSTRAINT [DF_PhotoComment_ReportedAsSpam] DEFAULT (0),
IsSpam bit NOT NULL CONSTRAINT [DF_PhotoComment_IsSpam] DEFAULT (0),
IsApproved bit NOT NULL CONSTRAINT [DF_PhotoComment_IsApproved] DEFAULT (1),
CreatedDate datetime NOT NULL,
CreatedBy uniqueidentifier NOT NULL,
UpdatedDate datetime NOT NULL,
UpdatedBy uniqueidentifier NOT NULL,
IsDeleted bit NOT NULL CONSTRAINT [DF_PhotoComment_IsDeleted] DEFAULT (0),
CONSTRAINT [FK_PhotoComment_PhotoID] FOREIGN KEY (PhotoID) REFERENCES dbo.Photo(PhotoID),
CONSTRAINT [FK_PhotoComment_CreatedBy] FOREIGN KEY (CreatedBy) REFERENCES dbo.aspnet_Users(UserId),
CONSTRAINT [FK_PhotoComment_UpdatedBy] FOREIGN KEY (UpdatedBy) REFERENCES dbo.aspnet_Users(UserId)

Design 2: The "Arc" relationship

CREATE TABLE dbo.Comment
CommentID int IDENTITY(1,1) NOT NULL,
CommentType char(1) NOT NULL CHECK(CommentType IN ('A','I','E','G','U','P')),
Body ntext NOT NULL,
ReportedAsSpam bit NOT NULL CONSTRAINT [DF_Comment_ReportedAsSpam] DEFAULT (0),
IsSpam bit NOT NULL CONSTRAINT [DF_Comment_IsSpam] DEFAULT (0),
IsApproved bit NOT NULL CONSTRAINT [DF_Comment_IsApproved] DEFAULT (1),
CreatedDate datetime NOT NULL,
CreatedBy uniqueidentifier NOT NULL,
UpdatedDate datetime NOT NULL,
UpdatedBy uniqueidentifier NOT NULL,
IsDeleted bit NOT NULL CONSTRAINT [DF_Comment_IsDeleted] DEFAULT (0),
CONSTRAINT [FK_Comment_CreatedBy] FOREIGN KEY (CreatedBy) REFERENCES dbo.aspnet_Users(UserId),
CONSTRAINT [FK_Comment_UpdatedBy] FOREIGN KEY (UpdatedBy) REFERENCES dbo.aspnet_Users(UserId),
CONSTRAINT [UC_Comment_CommentID_CommentType] UNIQUE (CommentID, CommentType)

-- Article Comments --
CREATE TABLE dbo.ArticleComment
ArticleID int NOT NULL,
CommentID int NOT NULL,
CommentType char(1) CONSTRAINT [DF_ArticleComment_CommentType] DEFAULT 'A', CHECK (CommentType = 'A'),
CONSTRAINT [FK_ArticleComment_ArticleID] FOREIGN KEY (ArticleID) REFERENCES dbo.Article(ArticleID),
CONSTRAINT [FK_ArticleComment_CommentID] FOREIGN KEY (CommentID) REFERENCES dbo.Comment(CommentID),
CONSTRAINT [FK_ArticleComment_CommentID_CommentType] FOREIGN KEY (CommentID, CommentType) REFERENCES dbo.Comment(CommentID, CommentType)

Design 3: The one that breaks the rules

CREATE TABLE dbo.Comment
CommentID int IDENTITY(1,1) NOT NULL,
ObjectType char(1) NOT NULL, /* A = Article, P = Photo etc... */
XID int NOT NULL, /* Would be the ID of the main entity being queried. */
Body ntext NOT NULL,
ReportedAsSpam bit NOT NULL CONSTRAINT [DF_Comment_ReportedAsSpam] DEFAULT (0),
IsSpam bit NOT NULL CONSTRAINT [DF_Comment_IsSpam] DEFAULT (0),
IsApproved bit NOT NULL CONSTRAINT [DF_Comment_IsApproved] DEFAULT (1),
CreatedDate datetime NOT NULL,
CreatedBy uniqueidentifier NOT NULL,
UpdatedDate datetime NOT NULL,
UpdatedBy uniqueidentifier NOT NULL,
IsDeleted bit NOT NULL CONSTRAINT [DF_Comment_IsDeleted] DEFAULT (0),
CONSTRAINT [FK_Comment_CreatedBy] FOREIGN KEY (CreatedBy) REFERENCES dbo.aspnet_Users(UserId),
CONSTRAINT [FK_Comment_UpdatedBy] FOREIGN KEY (UpdatedBy) REFERENCES dbo.aspnet_Users(UserId),
CONSTRAINT [UC_Comment_CommentID_ObjectType_XID] UNIQUE (CommentID, ObjectType, XID)
-- Ex: Get all comments for article ID 23.
SELECT * FROM Comment Where ObjectType ='A' and XID = '23'

View 1 Replies

Architecture :: Use A C# Class Or A Interface?

Feb 3, 2011

I have a block of SQL statements that I like to use as a sort of function.

I was thinking that I could make a class and inherit all of the master function, then add the parts that I need for other sections of the program in a sub class.

The problem is, up to this point I've been programming ASP .Net through visual studio, and it's kind of just programming behind controls. I'm not sure where to put the class/function/method/interface, or whatever we call it.

Of course you probably know that visual studio creates a bunch of partial classes when you do an ASP. Net application... so.. to get access to a function like object, across classes.. use an Interface?

View 7 Replies

DataSource Controls :: How Get Sum Of Different Pairs

Mar 13, 2010

The table design is like this:

ColumnA -- varchar(50)
ColumnB -- varchar (50)
ColumnC -- int
The table data is like this:
ColumnA ColumnB ColumnC
Abc def 10
Abc pqr 10
Abc def 20
Def pqr 50

The required output is:

Abc def 30
Abc pqr 10
Def pqr 10

That is if the records of the different rows of ColumnA & ColumnB are same then sumation of ColumnC should be done. Otherwise data is displayed as it is.

View 3 Replies

C# - Can Use Config File For Key Value Pairs

Nov 1, 2010

I have several key value pairs or mapping value, like Eg: Liquid Manufacturing -> Processing+Batching+Filling+Sealing

There are several such key value pairs. These values might change frequently. Whats the best practice? Can I save them to XML based config files? or database? Can I have them in a config file and read it into a dictionary and use it in my application?

"When will they change? Can the user change them or is it changed when the application is installed? Is the setting per user or per application? Is the setting valid only for one machine or does the same setting apply to clients on several machines?"

User cannot change them. Setting applies to entire application, all machines.

View 4 Replies

Architecture :: How To Make The Class Libraries

Jan 22, 2010

Task is to develop class libraries that can be re-use in projects but assambies should be copy righted. By this I mean developer will not give the code of class libraries to the clients yet they will provide the code of there sites/ applications, these libraries will be used just as internal development libraries. I want to make Business Logic Layer, DAL, Business Objects as class libraries

Q1. How I can control unathorised use of libraries ?

Q2. How to make assamlies non extendable ?

Q3. What security measurs I should take on this.

View 6 Replies

Architecture :: What Is The Function Of Abstract Class

Oct 24, 2010

what is the function of abstract class, why design pattern need to build BLL and DAL

anyone give an example for my reference as I am getting strat to build my web-based project

View 3 Replies

Radio Button Pairs Of Same GroupName?

Aug 18, 2010

I have some radio button pairs of same groupName. If I set one radio button to checked = True , as a result, the view is not displayed. I'm writing the code in aspx.cs but view is not updated. For other controls its get updated.

chatSettingsNode = xDoc.SelectSingleNode("//ToolBarChatSettings/ChatSettings/AdminSettings/Emoticons");
valueChk = chatSettingsNode.InnerXml;
value = Convert.ToBoolean(valueChk);
if (value == true)
rbtnAdminEmoticonsYes.Checked = true;


View 2 Replies

.NET Matching Id On Label And Input Pairs?

Feb 10, 2011

Is have about 20 label/input pairs on a page that use JS to give them unique styling. For this to work they must have matching id's on each pair.

This is the way the I would like the HTML to be formatted:

<p class="radioBtn">
<label for="business00"></label>
<input id="business00" type="radio" name="radioBtn" value="" />[code]....

and so on.Can this be achieved using ASP.NET?

View 1 Replies

Architecture :: Creating A DB Connection In My DAL Class File?

Feb 17, 2010

Below is my class file.


View 1 Replies

Architecture :: Singleton Pattern And Abstract Class?

Aug 19, 2010

I know what Singleton Pattern means and Abstract class means.What I wanted to know was how would this apply to real world.Could anyone give me any good example or simple explanation.Say I have a simple website, why would I use any of the above if any.Why would it simplify my architechture.

View 3 Replies

Architecture :: Advantage Of Singleton Class Over Static?

Mar 30, 2010

See in below I have writtine a

1. Singleton class Emp1 with Display Method and
2. Static Class with Static Method Display.

What is the advantage of singleton class over Static Class with Static members?


View 9 Replies

Architecture :: Singleton Class Could Be Inherited And Derived?

Oct 25, 2010

Just wanted to know if a singleton class could be inherited and derived.

View 2 Replies

Architecture :: Design A Class For Product Searching?

Oct 21, 2010

I'm refactoring an old website that has product search code littered throught the codebehind. I'm trying to encapsulate the search logic into its own class so I've created a Product class with a Search() method. I would like some suggestions about OO best practices so that the class is reusable and maintainable. The questions I have are:

- Should I make the search() method an instance method or make it static? For now the class is just really there to encapsulate my search logic

- If I make it an instance method should it return a list of products or should it populate a member property that I can access like p.Search(); var x = p.ProductList;

- The search method requires upward of 7 parameters of different types, what's the best way to provide them?
- pass them all i.e. p.Search (param1, param2, ..., param7)
- create a SearchParams structure in the class, populate it and pass that i.e. p.Search(searchParams)
- Instantiate a Product object and set properties on it that are used by the Search method i.e. p.ID = 123; etc.... p.Search();

I've used variations of the above before but would like to know what's the best way.

View 1 Replies

Passing List Of Name / Value Pairs To Stored Procedure?

Aug 10, 2010

I have a name/value pair in a List<T> and needing to find the best way to pass these to a stored procedure.

Id Name
1 abc
2 bbc
3 cnn

What is the best way to accomplish this?

View 3 Replies

Architecture :: Creating A Separated Class For Database Connection?

Dec 10, 2010

i have the following code:


I was trying to implement as above. How can i call this class from the code behind of my page, and call the methods Open and Close connection ?

How do i instantiate the object ?

View 5 Replies

Architecture :: Access Class Files Not In App_Code Folder

Feb 25, 2010

I have a single project. and I have two folder in it. In the 1st folder I have a class named Class1 and in the 2nd folder I have a class named Class2. Can anyone tell me how I can access members of Class1 in Class2. I have tried by adding namespace in Class1 and Using that namespace in Class2. But it is giving error. It is easy to access classes or their members from App_Code folder. I don't want to put my classes in app_code folder.

View 3 Replies

Architecture :: Sequence And Class Diagram Of An Existing Website?

Nov 17, 2010

I want to undertand and change an existing website which was written long time back. It cntains a lot of code and I dont know where to start as there is no dicumentation.Is there any way by which i can create a class diagram and sequence diagram of the existing one as I want to incorporate all the existing functionalities in the new one and dont miss out anyone. Only way I know is to debug the current application and go through whole of the code individually. Is there any way out by which I can undertand the current application quickly?

View 1 Replies

Copyrights 2005-15, All rights reserved