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
  • Difference between Generalization, Abstraction, Encapsulation?

    oop question
    4
    0 Votes
    4 Posts
    0 Views
    P
    Your Welcome!!! Praveen Raghuvanshi Software Developer
  • 0 Votes
    4 Posts
    1 Views
    R
    I am getting a bit confused here about what it is that you are REALLY trying to get to... I am sure that your system could probably just do a numeric increment (IE: username1@..., username2@..., etc...) but that is not going to guarantee that someone has those addresses registered, or even wants you know know about them or use them. I would rather see that you just stick yo your initial requirements really. Your original requirements were to allow people to only vote once. YOU cannot be responsible for people that have multiple email addresses setup (like I do - in reality almost 12 in total for various reasons) nor do I think it is your responsibility to care really. If someone signs up like that whats the big deal? I would think that making assumptions bassed upon some personally designed algorithm could lead you down a slippery path of ticked off customers more than anything in the long run. Do some basic checking (IE: If they are dumb enough to sigh up using different user names but then use the exact same user name and password, or actual name, or addresses, etc...) and remove them, but the others, whats the big deal? LinkedIn[^] | Blog[^] | Twitter[^]
  • 0 Votes
    2 Posts
    0 Views
    D
    Although it's not stated directly, I assume that your question is about .NET (the word 'assembly' points in this direction). We solved this problem by creating an extra level of methods around the instantiation points of implementation, like this: class DbFactory { public static InterfaceDb Make(string kind) { switch (kind) { case "xml": return MakeXmlDb(); case "sql": return MakeSqlDb(); } throw new ArgumentException("kind"); } private static InterfaceDb MakeXmlDb() { return new XmlDb(); } private static InterfaceDb MakeSqlDb() { return new SqlDb(); } } This code does not throw an exception when the assembly with SqlDb is missing unless you call Make("sql"); calling Make("xml") runs fine as long as the assembly with the implementation is present. Note: this functionally equivalent code does not work the same way: class DbFactory { public static InterfaceDb Make(string kind) { switch (kind) { case "xml": return new XmlDb(); case "sql": return new SqlDb(); } throw new ArgumentException("kind"); } } This code requires both assemblies to be present.
  • SCRUM

    business sharepoint collaboration tools help
    5
    0 Votes
    5 Posts
    0 Views
    R
    I have worked in Scrum team and i assure it is no way Waterfall model, rather mix of and more near to iterative model, v-model, spiral model,.. The rough estimation is usually done for a story first by product owner. Say a story is estimated with 8 hours of task. Then we distribute cards to team which have 7 cards each with 1,2,3,5,8,13,20. Each member tells his estimate for work. One on extreme side usually justify their estimates and we come to conclusion by discussion.
  • Developing to try to make a difference?

    question design
    14
    0 Votes
    14 Posts
    0 Views
    T
    And I can give a lot more detail than this. On some of the ideas I have. The final product is a AAC device for communication. But there are many programs that can be written before that, to help people get to that point. Like for example: A program that uses google images. Sends a random word to the database, an image is returned. The name is read out loud, then a game is created showing letters. The person then has choices of letters they can use. Some are right and some are wrong. Make it like a game, its fun and it teaches. Also add the ability to put your own words in to search on for the game. One of my sons favorite things in the world is hangers. And I use google images to teach him with that, because he is interested and fascinate by cloths hangers. You would not find that in a regular kids game. Just one example. Also something people not be aware of. And why I am leaning more towards the android Tablet. The keyboard gives a slight vibration when typing. I am not sure yet but if the keyboard can do that, I am thinking images on the screen might do that too.. Its feedback that a person with a development challenge might find calming to the nervous system. There is a behavior that some autistic people do. It is called Stimming. From what I understand about this behavior it is the vibration from the repeated movement that calms the nervous system. This is only a theory as I yet have a device to test this with. But I think the slight vibration of the keyboard would give an autistic individual an incentive to want to use the device.
  • 0 Votes
    2 Posts
    0 Views
    D
    Since much detail has been left out (which is expected, given that it's an architecture forum) I'd make an assumption that finding the "best matching" can be expressed mathematically as finding an extremum of a function of some sort, and that the product list is stored in a SQL database. Suppose that the quality of the match can be evaluated as a function MatchQuality. When you get parameters of a person for whom you're finding a matching product, you can build a SQL query that corresponds to your MatchQuality function and the parameters of the given person. Consider this silly example: suppose your MatchQuality(age, weight, water, nitro) = age^2/nitro + water/weight, and the match is best when MatchQuality is highest. A query for the best product comes in: weight=170lb, age=65yr. The query below returns the best match: select top 1 from Products order by (65*65)/nitro + water/170 desc
  • Some thoughts about virtual methods [modified]

    c++ discussion csharp php asp-net
    7
    0 Votes
    7 Posts
    0 Views
    D
    From a perfectionists' point of view, having job callers deal with sequences of calls violates encapsulation: job callers do not need to know that a job requires a "setup" and a "cleanup" steps. To hide the internals from your callers while keeping the distinction in your implementations, make an abstract class with a skeleton method, then override pre/post/job methods as needed in your derived classes. This technique is commonly known as the "Template Method" pattern[^]; I prefer "skeleton" to avoid confusion with C++ templates. AbstractClass::Job() { doPreJob(); doJob(); doPostJob(); } DerivedClass::doPreJob() {} DerivedClass::doJob() {} DerivedClass::doPostJob() {} JobCaller() { pAbstractClass -> Job(); }
  • Possible inefficiency in post-increment FOR loop?

    c++ graphics tutorial question
    7
    0 Votes
    7 Posts
    1 Views
    D
    Pre-increment's return value is the iterator itself, while post-increment must return a copy of the iterator before it has been incremented. Since the for loop discards the return value, using the pre-increment version of the ++ operator saves some CPU cycles by not making a copy that will be discarded anyway. A longer explanation is here.[^] Edit: Oops, I did not see that there were so many replies already. Only the OP was visible at the bottom of the forums window.
  • Database Code

    database json tutorial question php
    2
    0 Votes
    2 Posts
    0 Views
    D
    In my experience, when it comes to "combinatorial explosions", your projections (i.e. $columns) and ordering (i.e. $orderBy) are not as much a problem as the query conditions themselves: you will need to hard-code nearly as many values passed for the $where as the number of 'get<...>by<...>' functions you previously needed to code. The solution I've been using is generating my 'where' clauses dynamically. This way, instead of pre-made 'where' clauses you'd build collections of uniform items from which your SQL can be generated. For example, a list of name-value pairs could be used to generate a conjunction like name1=value1 AND name2=value2 AND ... nameN=valueN. More advanced solutions include use of expression libraries, such as LINQ's Expression in .NET, to formulate composite queries of arbitrary complexity (with 'OR's, 'AND's, 'NOT's, and function calls). P.S. Any time you generate SQL dynamically you should be very careful to avoid the SQL Injection Trap; other than that, you should be OK.
  • Application design code samples

    csharp design business tutorial
    3
    0 Votes
    3 Posts
    0 Views
    K
    http://www.guidebookgallery.org/books/thewindowsinterfaceguidelinesforsoftwaredesign[^] Everything makes sense in someone's mind
  • Object heuristic

    visual-studio design json oop performance
    5
    0 Votes
    5 Posts
    0 Views
    P
    The decision you have to make is all about dependency. The first alternative implements a loose dependency between the controller and model. In the second alternative, the dependency is hard coded into the controller. Therefore I definitely vote for the first one. However, I am surprised that you are given this choices at all. Without knowing much about IPhone UI programming, all the other UI frameworks I know have some kind of preferred architecture model. While you can program "around it", by doing so you exclude yourself from using certain techniques or tools which could make your application unusable by third parties or make things like customization, styling, themeing etc... exteremly difficult. For example, Microsoft's presentation frameworks like WPF or Silverlight do not enforce a specific model but if you choose not to follow the guidance, you exclude yourself from things like easy data binding, dynamic UI composition, easy cooperation with designer tools and much more... So follow Luc's advice and have a look at some exemplary IPhone applications or even better on Apple's guidelines about the architecture model for UI. Cheers, Paul
  • Need guidance on designing and preparing MCPD

    tutorial csharp wpf question
    4
    0 Votes
    4 Posts
    1 Views
    L
    Sorry, but I don't work for Microsoft. The link I gave you was the result of a Google search which offers various web sites with information that may help. Just say 'NO' to evaluated arguments for diadic functions! Ash
  • 0 Votes
    3 Posts
    0 Views
    R
    Classes are extensible by nature. So you can extended them as required. Apply patterns to your class as required. Don't apply patterns that are not required, otherwise in the future, you will assume that the class behaves in a way it doesn't. Architecture is extensible, code is minimal.
  • Diagramming?

    database xml question
    2
    0 Votes
    2 Posts
    0 Views
    L
    dawmail333 wrote: Where's best to start for doing diagrams? Depends on the job being done, but generally state transition diagrams and event trace diagrams are pretty usefull. (and often the only diagrams done) "It is a remarkable fact that despite the worldwide expenditure of perhaps US$50 billion since 1990, and the efforts of tens of thousands of scientists worldwide, no human climate signal has yet been detected that is distinct from natural variation." Bob Carter, Research Professor of Geology, James Cook University, Townsville
  • Guidance on solution and project structure.

    question learning
    7
    0 Votes
    7 Posts
    0 Views
    B
    I disagree with your ideas. We have a few solutions, and some of them share projects, e.g. both Solution1 and Solution2 make use of ProjectA. And here, the structure you suppose would fail. Our sln files reside in the "main" project of a solution, not in a shared project. When shared projects contained sln files, I would not like that either.
  • A questing about software design methodology

    design business help question
    8
    0 Votes
    8 Posts
    0 Views
    R
    lol 80% done. I only laugh because personal or professional, that's probably the honest truth. Architecture is extensible, code is minimal.
  • Development Methodology

    wpf question
    4
    0 Votes
    4 Posts
    0 Views
    R
    I struggle with this question teaching Project Management. There is no standard. Each organization is different in there approach and each project within an organization is different. You need to "customize" a methodology to meet the organization's development guidelines and at the same time meet the project requirements. So keep an open mind and customize the templates and guidance you find to the project at hand.
  • Why use Visual Studio?

    csharp php asp-net database mysql
    5
    0 Votes
    5 Posts
    0 Views
    R
    Visual Studio Express editions are free. You need to look at the development team and the tools they are familiar with. If they are familiar with VS then you need to consider what are the appropriate VS licenses for each member. If the team are PHP developers then VS is a total waste of time. Find out what tools the development team are familiar with and use them. A cost analysis of retraining the team might be a sobering reality for the reviewers.
  • Estimation of server for launching a site

    help question sysadmin
    5
    0 Votes
    5 Posts
    0 Views
    L
    sizes get measured on a development system, and if necessary on a mock-up. Just measure total size for quantity 1, 10, 100, 1000 and you'll know unit size. Quantities you need to estimate yourself. No tools involved, just common sense. :) Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
  • 2D Tile Based Scrolling

    java sysadmin performance help question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied