Skip to content

Design and Architecture

Discussions on Design, Patterns and Architecture

This category can be followed from the open social web via the handle design-and-architecture@forum.codeproject.com

5.3k Topics 10.4k Posts
  • Code portability - .NET/Unix

    csharp question c++ dotnet design
    8
    0 Votes
    8 Posts
    0 Views
    W
    The list for platforms isn't very long, see. http://www.mono-project.com/Supported_Platforms[^] Also have alook at http://mono-project.com/FAQ:_General#Availability[^] The need to optimize rises from a bad design. My articles[^]
  • Loading objects

    question design tutorial discussion
    5
    0 Votes
    5 Posts
    0 Views
    C
    led mike wrote: How are any of the options you posted in your first post, part of the MVC design? I never said my options had anything to do with MVC pattern. I use MVC pattern but in this case my question is not about MVC. My question is closely related to the observer pattern. You have an object of a class which is being observed by the form by subscribing to its events. Now when the user selects a different object from a treeview (or whatever), this class will become the new object the form is observing and the form should display its data. But the form can only do so once the object fires the event. But the object will fire the event when its state changes so the form has to wait until the user changes the state of the object. So now we are stuck because this is what has been happening so far: First an object was selected from the treeview. The object is sent to the form. The form subscribes to its events. The events are not fired so how do we display it? The solution I came up with is to trigger the event through a public method--just like we can trigger events in .NET by calling OnPaint. Now the form can display the data. So I think the answer to my question is to set the property and send a reference of the object to the form. Afterwards, force the objects event by triggering it through a public method. But I am still not sure if this a good solution.
  • one questions about Builder Pattern

    com regex tutorial question
    2
    0 Votes
    2 Posts
    0 Views
    C
    Builder pattern consists of 4 parts: 1. Builder-This is an abstract class 2. ConcreteBuilder 3. Director-This is the site where the construction occurs by calling the ConcreteBuilder 4. Product-This is the thing being built public class Demo { public static void main(String args[]) { Builder b = new ConcreteBuilder1(); Director d = new Director(); d.construct(b); // We tell director to construct a product using b as the builder and director // will call the appropriate methods on b. We do not need to know how the director // will do this, we assume the director knows this. Product aProduct = b.GetProduct(); // Now we ask b to give us the built product b = new ConcreteBuilder2(); d = new Director(); d.construct(b); Product anotherProduct = b.GetProduct()); } } Therefore, you need the product class because after all you are after the built product at the end. It is like going to a construction site and taking a builder with you. You ask the person in charge at the construction site (Director) to construct a house for you using the builder you introduced to the person in charge. The person in charge should know the sequence and what parts are needed to build a house but does not know how to build it. He simply asks the builder to build the parts. The builder now has a complete house. To see the completed house, you ask the builder for the house. I personally think we should ask the Director for the finished product as well and the director should ask the appropriate builder, but for some reason that is not the case.
  • Phone Number Internationalization

    xml question
    5
    0 Votes
    5 Posts
    0 Views
    T
    Hi, I hope this helps you or at least someone. I am by no means a professional programmer but more of an extreme hobbyist, but I have seen the phone number internationalization done and maybe I can relay the info...remember, I am self taught so I'm sure there will be holes in my explanation but the practice its self works. I use this in an international logistics system, and instead of a drop down, we utilize a box where we can enter the countries ISO code (or select it from a grid). The format for the phone number is then set in the phone number field, whether that be phone, fax or mobile. This is all done by 3 files; phonetypelist, phoneformatandvalidation, and phoneinfo. PhoneTypeList contains the type of phone numbers, i.e. fax, phone, mobile and other. PhoneFormatAndValidation contains the rules for formating the numbers and the functions for executing the conversion of 7134921212 to +1 713-492-1212. This file is pretty complex since it contains the rules, but it's a fairly small file (class), only 30 kb. The file that contains the dataset is in this format: If (PhoneInfo.fData Is Nothing) Then PhoneInfo.fData = New PhoneInfoDataTable Dim row As PhoneInfoRow = PhoneInfo.fData.NewPhoneInfoRow row.CountryIsoCode = "AC" row.CountryDialingCode = "247" row.InternationalPrefix = "01" row.NationalPrefix = "" row.AreaCodeLength = 1 row.LocalNumberLength = 4 PhoneInfo.fData.Rows.Add(row) row = PhoneInfo.fData.NewPhoneInfoRow row.CountryIsoCode = "AD" row.CountryDialingCode = "376" row.InternationalPrefix = "00" row.NationalPrefix = "" row.AreaCodeLength = 1 row.LocalNumberLength = 6 Hopefully that helps, but if you need additional info, feel free to let me know. Thanks, Joe modified on Tuesday, November 18, 2008 9:14 AM
  • Hi there :) Please help me

    question csharp wpf help learning
    2
    0 Votes
    2 Posts
    0 Views
    V
    You are Posting in a Wrong Place , go to Silverlight Forum, i think i saw your Qustion somewhere ,Stop Cross Posting Vuyiswa Maseko, Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding VB.NET/SQL7/2000/2005 http://vuyiswamb.007ihost.com http://Ecadre.007ihost.com vuyiswam@tshwane.gov.za
  • Workflow Services

    database sharepoint sql-server sysadmin algorithms
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Patterns

    question asp-net database regex architecture
    8
    0 Votes
    8 Posts
    1 Views
    S
    If its me ... I think I would solve this issue by using the concept of metadata ... the concept ! .. Well in this particular case I think I would use reflection and .NET Attributes ... reflection will help me to get the Fields (Person Class Properties) ... and .NET Attributes to determine which Fields shall be used ... for example public class Person { private string name; [Displayable] public string Name { get { return name; } set { name = value; } } private int age; [Displayable] public int Age { get { return age; } set { age = value; } } private string officialID; public string OfficialID { get { return officialID; } set { officialID = value; } } } Now the Displayable Attribute is a custom .NET Attribute you create ... using reflection I can determine whether this Field has the Displayable attribute or not ... and some kind of class will know how to map this class with its Displayable Fields to the UI for example ... Hard ... but doable ... and in complex applications could lead to problems if its not designed well ... but mainly in rare cases like yours it could work depending on your business. Sincerely Samer Abu Rabie Note: Please remember to rate this post to help others whom reading it.
  • Database Engine Independant Data Modelling

    database mysql sql-server question
    3
    0 Votes
    3 Posts
    0 Views
    E
    Hi Brad Please don't pre-judge ORM solutions. With good engineering concepts and common sense you can take a good approach with this point of view I invite you to visite our solution at www.codeplex.com/circo (not a ORM from books but form the experience of engineers who needs to struggle with diferent customers, clients, languages an programming cultures) I hope you find useful this ideas and esentially the implementation Regards
  • 0 Votes
    4 Posts
    0 Views
    G
    thanks so much for replying, but someone on the Microsoft newsgroups gave me a work around with CR. I make a new typed dataset for each report that I want to create, I have seperate tables for each chunk of data I need printed.Then I design a new report, when I need the data printed I set the datasource to a new instance of the typed dataset with all my data in it! It works like a charm, also for situations where I've needed Multiple bunches of information all over the place, I use subreports, somehow the dataset passed to the first report is automatically passed to the subreports too, so it works pretty well. Thanks!
  • designing a good way enable/disable controls [modified]

    design sales
    11
    0 Votes
    11 Posts
    0 Views
    M
    I would split the UI management into 2 distinct types, 1 based on permissions and user group membership and 2 state of the data. Either way it is custom coding for each form. I like the idea of binding the enabled/visible attribute. I use a permissions table that is returned from the login with all the permissions for the logged in user. Then each form checks this table for defined controls. While I implement this in all apps it is rarely used(corporate). Never underestimate the power of human stupidity RAH
  • Data structure design

    data-structures help question design cryptography
    9
    0 Votes
    9 Posts
    0 Views
    C
    What if you did something like this: Create a class called ClientCollection which will have all the clients in some data structure of your choice. Within this class (ClientCollection) have a method called Search, or Find which will take 2 parameters: 1. The property to search by and 2. The value to search for. Within this method create a Dictionary and put all your clients into it. The property to search by will be the Key, and the value will be the Clients. Afterwards, call the Contains method of the Dictionary to search the value passed in. Of course, this means that if you have many clients putting them into the Dictionary will take time. I will also do what you suggested above in addition to this but create tables for the field(s) which will be used mostly for searching. Now you don't have too many tables, but you are also providing the flexibility of searching by any field.
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • Replicating Business Rules on a Web Client

    question javascript sysadmin business
    3
    0 Votes
    3 Posts
    0 Views
    M
    Good call. Especially with click-once, and especially for line of business apps when you typically control the client environment. Mark Churchill Director, Dunn & Churchill Pty Ltd Free Download: Diamond Binding: The simple, powerful, reliable, and effective data layer toolkit for Visual Studio. Alpha release: Entanglar: Transparant multiplayer framework for .Net games.
  • Best Practices for Code Organization

    csharp visual-studio design tutorial
    3
    0 Votes
    3 Posts
    0 Views
    L
    I tend to follow these when possible; http://msdn.microsoft.com/en-us/library/893ke618(VS.71).aspx
  • Form Template - requirement gathering

    question sales tutorial career
    6
    0 Votes
    6 Posts
    0 Views
    P
    That's a nice find, Richard. It looks like one to definitely bookmark for reading later tonight :) "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
  • Canal Manager framework for distributed application

    com sysadmin lounge
    8
    0 Votes
    8 Posts
    0 Views
    A
    Thank you for these references! I think, the Channel Manager could be built on, for example, RabbitMQ. But, now is more interesting if Channels/Ports paradigm with the specific message exchange protocol used in the Channel Manager could be really useful. (I think, so but I'd like to discuss) Anatoly Medyntsev, Leading Software Engineer, Arcadia Inc.
  • 0 Votes
    9 Posts
    0 Views
    G
    Thanks so much Mark, it all looks good on paper so far!
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • Non-centralized app design - Good idea?

    design sysadmin help question workspace
    3
    0 Votes
    3 Posts
    0 Views
    L
    I'm not sure what Mark specifically is suggesting but in general his comments seem to be an improvement over what you posted. One interpretation of what he said is that taking a simpler strategy, e.g., a single server, and using standard tools to account for resilience, redundancy etc. On the other hand your post tends to sound like a peer to peer system. Perhaps you should find and study some technical information about P2P designs and issues. You may find some of the information/issues match your situation and gain some insight on the architecture and it's associated benefits and drawbacks. led mike
  • 0 Votes
    1 Posts
    0 Views
    No one has replied