Search Results

Search found 14602 results on 585 pages for 'objected oriented design'.

Page 47/585 | < Previous Page | 43 44 45 46 47 48 49 50 51 52 53 54  | Next Page >

  • When should I use a struct instead of a class?

    - by Esteban Araya
    MSDN says that you should use structs when you need lightweight objects. Are there any other scenarios when a struct is preferable over a class? Edit: Some people have forgotten that: 1. structs can have methods! 2. structs have no inheritance capabilites. Another Edit: I understand the technical differences, I just don't have a good feel for WHEN to use a struct.

    Read the article

  • Design pattern to separate messages from actual process.

    - by Manish Gupta
    I am having a C# application to sync data between PC and palm devices. There are codes written like below: showMessage("synchronizing Table1"); Sync(destTable1,sourceTable1); Sync(destTable2,sourceTable2); showMessage("synchronizing Table2"); // more code How do I separate the actual process of synchronizing from displaying message? Which design pattern to follow? Thanks in advance...

    Read the article

  • Inheritence and usage of dynamic_cast

    - by Mewzer
    Hello, Suppose I have 3 classes as follows (as this is an example, it will not compile!): class Base { public: Base(){} virtual ~Base(){} virtual void DoSomething() = 0; virtual void DoSomethingElse() = 0; }; class Derived1 { public: Derived1(){} virtual ~Derived1(){} virtual void DoSomething(){ ... } virtual void DoSomethingElse(){ ... } virtual void SpecialD1DoSomething{ ... } }; class Derived2 { public: Derived2(){} virtual ~Derived2(){} virtual void DoSomething(){ ... } virtual void DoSomethingElse(){ ... } virtual void SpecialD2DoSomething{ ... } }; I want to create an instance of Derived1 or Derived2 depending on some setting that is not available until run-time. As I cannot determine the derived type until run-time, then do you think the following is bad practice?... class X { public: .... void GetConfigurationValue() { .... // Get configuration setting, I need a "Derived1" b = new Derived1(); // Now I want to call the special DoSomething for Derived1 (dynamic_cast<Derived1*>(b))->SpecialD1DoSomething(); } private: Base* b; }; I have generally read that usage of dynamic_cast is bad, but as I said, I don't know which type to create until run-time. Please help!

    Read the article

  • (database design):Which tables should be created for all kindes files (images, attached email files,

    - by meyosef
    Hi, I new in database design: I have question with my own few solution,what do you thinks?: Which tables should be created for all kinds files (images, attached email files,text files for store email body, etc..) that stored in my online store? *option 1:use seperate table for files types * files{ id files_types_id FK file_path file_extension } files_types{ id type_name (unique) } *option 2: use bool field for each file type * files{ id file_path file_extension is_image_main is_image_icon is_image_logo is_pdf_file is_text_file } **option 3: use 1 enum field 'file_type' for each file type ** files{ id file_path file_extension file_type (image_main,image_icon,image_logo,image_main,pdf,text) **enum** } Thanks you, Yosef

    Read the article

  • OOP design for DMS that allows searching and grouping

    - by James P.
    I'd like to make a searchable Document Management System and allow a user to group documents together. On one hand, there would be a functionality that registers/fingerprints in a linear fashion and, on the other, one that associates documents into groups. How could I compromise between the two in terms of object design?

    Read the article

  • Repository, Service or Domain object - where does logic belong?

    - by betitall
    Take this simple, contrived example: UserRepository.GetAllUsers(); UserRepository.GetUserById(); Inevitably, I will have more complex "queries", such as: //returns users where active=true, deleted=false, and confirmed = true GetActiveUsers(); I'm having trouble determining where the responsibility of the repository ends. GetActiveUsers() represents a simple "query". Does it belong in the repository? How about something that involves a bit of logic, such as: //activate the user, set the activationCode to "used", etc. ActivateUser(string activationCode);

    Read the article

  • PHP Access property of a class from within a class instantiated in the original class.

    - by Iain
    I'm not certain how to explain this with the correct terms so maybe an example is the best method... $master = new MasterClass(); $master->doStuff(); class MasterClass { var $a; var $b; var $c; var $eventProccer; function MasterClass() { $this->a = 1; $this->eventProccer = new EventProcess(); } function printCurrent() { echo '<br>'.$this->a.'<br>'; } function doStuff() { $this->printCurrent(); $this->eventProccer->DoSomething(); $this->printCurrent(); } } class EventProcess { function EventProcess() {} function DoSomething() { // trying to access and change the parent class' a,b,c properties } } My problem is i'm not certain how to access the properties of the MasterClass from within the EventProcess-DoSomething() method? I would need to access, perform operations on and update the properties. The a,b,c properties will be quite large arrays and the DoSomething() method would be called many times during the execuction of the script. Any help or pointers would be much appreciated :)

    Read the article

  • What would be a good starting point for development of a 3D application for representation of struct

    - by Lela Dax
    I was thinking QT on OpenGL. Multiplatform ability and being able to be closed (at no cost) at a later point would be important points. But I'm very interested in finding a way that is not only viable but also has the least amount of reinvention of the wheel. e.g. "Why not Ogre? A ready powerful 3D engine without reinventing that part". But I'm very uncertain in what is the optimal collection of tools for that job.

    Read the article

  • good c++ documentation design example?

    - by Eye of Hell
    Hello. I'm tuning documentation generator for internal purpose that generates HTML documentation for C++ classes and methods. Is it any example available of good HTML documentation design? MSDN ( like this ) looks kinda outdated, same is doxygen / javadoc / sphinx results. Anyone ever see an documentation that looks REALLY good?

    Read the article

  • Tools and environments supporting Domain Driven Design (DDD)

    - by anthares
    Hi everyone, I'm doing a kind of research on the topic "Domain Driven Design". My question is what tools (or maybe environments) do you use, that support this paradigm? I know that I can google it, but I wonder which of them actually work and are useful, since I have no experience with neither of them. I'm interesting mainly in the .NET Framework, but any other opinions are also welcome! Thanks !

    Read the article

  • How to properly dispose of an object

    - by VoodooChild
    Hi Guys, I am experiencing something weird and have a workaround already, but I don't think I understood it well. If I call the Method below numerous times within a class: public void Method() { Foo a = new Foo(); a.Delegate1Handler = ViewSomething(); } So I am reinitializing "a" every time but for some reason a.Delegate1Handler is still around from the previous initialization, and therefore ViewSomething() is called again and again and again.... I feel like I am forgetting something critical here? Foo's guts look like: public delegate void Delegate1(T t); public Delegate1 Delegate1Handler { get; set; }

    Read the article

  • Passing arguments between classes - use public properties or pass a properties class as argument?

    - by devoured elysium
    So let's assume I have a class named ABC that will have a list of Point objects. I need to make some drawing logic with them. Each one of those Point objects will have a Draw() method that will be called by the ABC class. The Draw() method code will need info from ABC class. I can only see two ways to make them have this info: Having Abc class make public some properties that would allow draw() to make its decisions. Having Abc class pass to draw() a class full of properties. The properties in both cases would be the same, my question is what is preferred in this case. Maybe the second approach is more flexible? Maybe not? I don't see here a clear winner, but that sure has more to do with my inexperience than any other thing. If there are other good approaches, feel free to share them. Here are both cases: class Abc1 { public property a; public property b; public property c; ... public property z; public void method1(); ... public void methodn(); } and here is approach 2: class Abc2 { //here we make take down all properties public void method1(); ... public void methodn(); } class Abc2MethodArgs { //and we put them here. this class will be passed as argument to //Point's draw() method! public property a; public property b; public property c; ... public property z; } Also, if there are any "formal" names for these two approaches, I'd like to know them so I can better choose the tags/thread name, so it's more useful for searching purposes. That or feel free to edit them.

    Read the article

  • Persistance Queue Implementation

    - by Winter
    I was reading an article on Batch Processing in java over at JDJ http://java.sys-con.com/node/415321 . The article mentioned using a persistence queue as a Batch Updater instead of immediately sending an individual insert or update to the database. The author doesn't give a concrete example of this concept so I googled Persistence Queue but that didn't come up with much. Does anyone know of a good example of this?

    Read the article

  • Creating design document from existing java code.

    - by BigBoss
    I have existing java code and need to create Design Document based on that. For starter even if I could get all functions with input / output parameters that will help in overall proces. Note: There is not commeted documentation on any procedures, function or classes. Last but not least. Let me know for any good tool which will reduce time required for this phase. As currently we write every flow and related stuffs.

    Read the article

  • Design a mini script language

    - by radi
    hi , my project this year is to develop a text mining tool (with new features) so we need a mini script language in this tool to add annotation to texts this language should be simple and like lisp grammars (left and right side) . what i need is how to design this language ,i know how to constract the compiler , but how to write language grammars ? , and i want to use some mini open source language or any language bnf please advice me and if there is a language i can use and customize to meet my needs ? thanks

    Read the article

  • Trade Server Design

    - by Avinash
    Hi, Does anyone has Exchange Trader server design. I want to understand how does it work, does it required queues, to handle multiple trades how to add various observers to the each request .

    Read the article

  • Guidelines for solution source code organisation(OO/DDD)

    - by fearofawhackplanet
    I'm starting on my first business project (.NET) and am trying to follow DDD principles. Are there any guidelines or common patterns for orgaining source code and namespaces? For example, do your domain objects go in a namespace MyProject.Domain or whatever? Would you separate the concrete implementations and the interfaces? In different namespaces? Different folders? Different solutions? I know a lot of this is subjective and dependent on project size, but a few pointers or suggestions to get started on a relatively small but extensible n-tier project would be useful.

    Read the article

  • My User control belonging to which Design Pattern??

    - by prashant
    Hello, I am creating a reusable component in C#.net. For that i have started a Control Library project and added a Control. Class MyControl : Control{} My user control just displays some images which will be used in many Windows Applications. Can you please tell me which design pattern i am using here. I am unable to decide which pattern they belongs. Thanks

    Read the article

  • Functional Programming Equivalent of Design Patterns Book?

    - by JasonFruit
    Is there a functional-programming equivalent to the Gang of Four Design Patterns book? That is, is there a book that explains and gives examples of how commonly-needed code structures are implemented functionally? I think seeing that would give me a better idea of how to go about using in practice the functional concepts whose theory I understand.

    Read the article

< Previous Page | 43 44 45 46 47 48 49 50 51 52 53 54  | Next Page >