Architecture :: How To Represent Scenario In A Relational Database

May 26, 2010

i'm new with design patterns and i'm not sure if in this situation i can use a composite pattern.

The scenario is a web application for an address book : the address book cointains AddressBoookItem, generalization for Contact and ContactGroup. The last one is the composite object containing a collection of AddressBoookItem.

With these scenario i'm sure that this is a composite pattern, but what is confusing me is that a contact may belong to many contactgroup. Does this request change the situation? Till now i thought that between the Leaf object and the Composite (in the composite pattern) there was a 1-to-m relationship (a composite may contains many leaf but a leaf is contained in only one composite object). Can i still use the composite pattern ? And, the last question,

How could i represent my scenario in a relational database? One table for the entire hierarchy or two table (Contact and ContactGroup) with a m:n relationship between them ?

View 3 Replies


Similar Messages:

C# - Mysql Database Relational Options

Mar 15, 2011

I have two tables one called Login and one called User there is a one to one relationship from the user table to the login table:

Login:
=-=-=-=-
LoginID (Primary, Not Null, Auto Inc)
UserID (Primary)
Username (not null)
Password (not null)
[code]...

View 1 Replies

Documentation For Retrieving Localized Relational Data From Database

Apr 20, 2010

I have successfully used resources to translate my UI and I am now moving on to allowing the ability for the admin to translate database content.I'm looking for video tutorials / docs on database structure for localised info and how to retrieve localised data using stored procedures based on the selected culture.

View 3 Replies

SQL Server :: Shredding Multiple Valued Element In Relational Database?

Nov 19, 2010

I have the following XML:

<IncidentEntity>

View 2 Replies

DataSource Controls :: Relational Field Not Updating On Update?

Mar 1, 2010

I have detailsview with a SQLDataSource to 1 table (City) and am referencing another table (Unit) for one if it's fields.

[code]....

I changed the Unit Code (City Table) field into a template field and am using a dropdownlist item to reference the Unit Name from the (Unit Table) with the CityTable.Unit Code = UnitTable.Unit Code. However when I go into the update and change the dropdownlist item to another Unit Name it is keeping the original Unit Code value or it might even be selecting the first value from the dropdownlist item.

View 1 Replies

Web Forms :: Wizard Server Control And Relational Data?

Jan 17, 2010

I am building a web based insurance application with VS 2008. Using the web wizard to enter newly created policy data and related information.My question is how to handles relational data in the wizard and saving that back to the database.A general idea of the setupEach policy can have multiple policy periodsEach policy period can have multiple sections and multiple policy feesSO The new wizard allows for a single policy entry, then we move to enter the policy periods. Which can be one or many per new policy, then we move to the sections and fees which can be ne or many per policy period.Each part is a step on the wizard. Policy, Period, Sections, Fees.The multiple entries are handled with an aspxgridview.NO problem in entering the data and completing the wizard, except when it comes to actually saving the data.Saving the policy and policy period information is easy because I can get the policyID value and assign that to each policy period.Problem comes in when I save the period child info. Because I can have multiple periods, I can't determine which child data (Sections and Fees) belong to which period so as to get the period ID.What process would you suggest, and how can I achieve this.I have thought of only allowing period entry per new policy. This will certainly solve the problem in a way, but does not conform to business rules.

View 1 Replies

Architecture :: Binding Of Gridview With Database Versus XML Layer / Database

Apr 13, 2010

I am having serious performances issues with gridview + tabs. Its very slow.. I was thinking to create a XML based logical layer between my database and UI.

1) Will it be useful if i use webservice to get data from database to poppulate gridview?

2) or Use xml + some service (need advice on it)

View 3 Replies

How To Represent Class Diagram In UML

Mar 3, 2010

I'm a novice developer writing an ASP.NET application with VB. I'm having a little trouble getting my head around the partial class concept. If you use the partial classes as a code-behind for the presentation, how would these be represented in UML, in particular with a class diagram?

View 2 Replies

Web Forms :: Exactly Does The Text='' Represent?

Apr 19, 2010

I'm using a text box in a template field to perform an insert with an object data source. What exactly does the "ProductID" refer to in this example? Is it the column in the db or the business object?

[Code]...

View 2 Replies

C# - How To Use ExecuteScalar In This Scenario

Dec 6, 2010

I have this SQL Select statement to select the basket id where the user id equals a specific ID.I want to store the result of the query in a variable, so I thought I could have done:

BasketPage.SelectCommand="SELECT BasketID FROM tblBasket WHERE (UserID = '9f96bd94-91b9-4328-8214-4eac179c3a26')"
var BasketID = BasketPage.ExecuteScalar().ToString();

But apparently I need to create a new instance of an SQL Command for it to work, how can I do this for the BasketPage Select Command?

View 2 Replies

Create Classes To Represent One To Many Relationships In C#?

Jun 20, 2010

how to create C# classes to represent one to many relationships in C#. I have a Customer and an Address table in my database. I also have a Customer class in my C# solution but how do I introduce the multiple address element? Do I have a separate Address class? Do I create a subclass in the Customer class or create a method in Customer called GetAddresses of type List which contains all of the relevant logic? In my code I need to be able to return a customer with all associated addresses and I just cannot picture the best way to achieve this using OOP.

View 9 Replies

C# - Use String Argument To Represent Object

Dec 21, 2010

If I have the following code:

TextBox txtUsername = new TextBox();
void setEnabled(string str, bool enable)
{
// use str to find the TextBox object
// str.Enabled = enable;
}

Is this kinda thing even possible? I want to be passing in 'Username' and then be prepending it with 'txt'.

View 5 Replies

Security :: What The Best Practice For Next Scenario

Apr 27, 2010

1) All users can browse open web site content.

2) To access memebrs area users must login.

3) Users can create , edit/update, delete there profile/information only.

4) Users can see / view other users profiles.

5) Admin can browse, create, edit/update, delete an any profiles.

I found many different ways to implement it, but what the best practice. May be you can point me in right direction.

Application Web based, MsSQL 2005, .NET 3.5, Server 2003.

View 1 Replies

Looking To Build An Application With The Scenario?

Mar 2, 2010

I was looking to build an application with the scenario:

1. The application is a Shared PowerPoint Presentation

2. There would be 2 users for the application, Admin and Client

3. Admin can upload presentations

4. Only Admin can control the flow of presentation and cLient can just see the changes

5. As-In Admin can select next slide or previous slide and correspondingly Client configuration changes

I was thinking of updating current values in Database and using AJAX for updates on Client end. But I want a notification kinda thing that would notify the Client as soon as the Admin changes slides.

View 1 Replies

C# - Get Value From Dropdown Control In Scenario?

Mar 9, 2011

My scenario is this:

I have asp.net page which having the drop down control with Product list. in database my Product Table has fields as ProductId, Product Name and Price. where as I have filled this drop down control by this method:

private void FillProducts()
{
List<Product> productList = objProductManager.GetProducts();
if (productList.Count > 0)
{
drpProducts.DataSource = productList;
drpProducts.DataTextField = "ProductName";
drpProducts.DataValueField = "ProductId";
drpProducts.DataBind();
}
}

Which is working perfect. But i want to get selected product Price value on client side. for that I don't want round trip at server to get that. is any property of dropdown control other than DataTextFeild Or DataValueField to hold the Price Field of product ? so that i would avoid to go back at server. Or suggest any remedy for the same.

View 4 Replies

Response.End() Mandatory In The Given Scenario?

Feb 1, 2011

string filePath = ExportAndSaveInvoiceAsHtml(invoiceId);
Response.AddHeader("Content-Disposition", "attachment;filename=" + Path.GetFileName(filePath));
Response.WriteFile(filePath);

[code]...

View 2 Replies

Forms Data Controls :: Make A Link After Displaying The Relational Data In The Gridview?

Jul 31, 2010

i have 2 dropdownlist and gridview. Im trying to make a link after displaying the relational data in the gridview like below But how can i get the value and combine with the link

[Code]....

this is the all of my code

[Code]....

View 2 Replies

Architecture :: Use Different Database For One Application?

Nov 24, 2010

How to use different database for One Application

View 6 Replies

Security - Using Roles To Represent Different Access Levels?

Mar 4, 2010

I need to design a system that will control access to certain information. The requirement from the user is to use access levels e.g.

Level 1 - Support
Level 2 - Manager
Level 3 - Senior Manager
Level 4 - Department Head
etc.

If a certain piece of information is marked as Level 1, then all roles should be able to view that piece of information. If it is marked as level 3, then only the Senior Manager and Department Head can view it, but the Manager and Support roles can't view it.

Questions

When I assign the access level to a piece of information, will I have to assign multiple roles to it in order for me to achieve this functionality? Is there a better way of doing this?

View 2 Replies

C# - Generate HTML To Represent Class And Its Properties?

Mar 2, 2011

Currently I have a class that represents a document. This document needs to be displayed as HTML. I would like to have a method to call such as GetHTML() that would then call GetHTML() on any properties/sections of the document that needed to be rendered. I was initially thinking about using linq and XElement but am wondering if that may cause issues with certain tags in HTML. Would I better off using an HtmlTextWriter?

View 2 Replies

DataSource Controls :: Use The Objectdatasource To Represent A Component?

Mar 20, 2011

I'm having trouble, I have a component called Search that has a SearchCars method I use both in the objectdatasource control like this:

<asp:objectdatasource
selectMethod="SearchCars"
typename="Search"

my question is what type of object should I return from the SearchCars method?

the method seginature accepts a business entity object "Car"

like that

public ????? SearchCars(Car car)

View 3 Replies

MVC :: Create A List Of Values & How To Represent A One To Many Relation?

Dec 21, 2010

i am working on a social networking project using MVC2 visual studio, currently i am working on these two tables , post & comment. Each post can have many comments.i have created a post controller along with the related view , and it work well , now i want to add under the post a comment view, where a post can have many comments , i can add the comments on different view , but i need to have a post and under it to add many comments, so how i can do so?

another problem is that in the post table there is a field representing a rating, now i can add in the rating field 1, 2,3,4,5,etc, but i need this field to be viewed as a list having values from 1-5?

View 8 Replies

MVC :: What Is The Recomended Validation Framework For Scenario

Jul 16, 2010

I am using ajax.beginform. i am inserting and updating records using ajax and showing the inserted or updated value in the div above the div containing form. I need to apply validtion on these values.what is the recomended validation framework for this scenario. i have problems pushing validation messages to the form as i can only update one div that is indicated in updatetargetid parameter of ajax.beginform and this value in my case is set to div displaying the updated/inserted data

View 7 Replies

Architecture :: Want To Add Record In Database With The Date?

Apr 11, 2010

In my application i want add record in database with the date. My need is that particular record should be deleted on a given date.Example: i have added one record on 1 Apr 2010 and it will be deleted on 25 Apr 2010.Any idea how to achieve this? I need a logic to delete that particular record automatically from the database on a given date. I am using MS SQL 2005.

View 6 Replies

Which Architecture Use To Access A Database With Web Services

Sep 10, 2010

Suppose we are building a web-based application to retrieve and enter information into a database. The user-interface invokes web services. Which architecture would use for the application.

View 10 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved