OOP Design Theory

Hi,
When designing a GUI Application, what is the best way to structure the objects.
Would It be best to have a functional class (the class that does all the processing work) and then have another class that is linked via composition, that handles all the GUI functionaility for that functionility (which is normally encapsulated within a window or dialog.
If so is it best for the functionility class to create and hold an instance of the GUI class or the other way round.
Many Thanks
Cheers
Alex

If I was to do it from scratch what implimentation
key points would you suggest.The key point is to use existing frameworks and focus on designing/building/coding the Model. The Model represents the core functionality of the application (what is does/the verbs of the application) which is based on domain/business requirements.
Before starting on anything related to implementation. The first step is to gather/derive/discover the domain/business requirements. Once you have the requirements, you can then start on creating a technical design, once you have a technical design, you can start on create a prototype of the application which implements a few of the highest.most important domain/business requirements.
Once you have an executable prototype, you can revisit the technical design and if everything is ok, you can work on the second phase of the prototype and implement a few more domain/business requirments.
Once you have the second iteration of an executable prototype, you can revisit the technical design and if everything is ok, you can work on the third phase of the prototype and implement a few more domain/business requirements.
When everything is implemented in the prototype, you can put the application into test mode and then when done with that put it in QA cycle....and then poof, you have a working software application. Sounds easy....good luck!
Check out the Spring Framework

Similar Messages

  • Bad OOP design?

    I have to access some data before my program starts (to prevent a slow down while the program is running). The thing is, I need to init some objects before my program loads. It works fine now, but when I do the thing that I need the objects for, it hangs for a very short time (while it creates them, you see, right now I can only create them when the action they are needed for is called; it is to detailed to explain). The problem is it just looks unprofessional. Anyway, java.awt.component has a method that would make it possible for me to do the object creation before the program starts. Would it be bad to make a class that extends Component, and then define a method in there that get the information I need to makes it possible for me to create my object before the program starts? Is this bad OOP design?
    Thank you!
    Joshua

    Of course you can't really initialize stuff "before your program loads" since the initialization is part of your program, just before you program tells the user it's loaded.
    Probably the way to intialise stuff early is to do it in static, which will happen as soon as the class loads.
    Mostly you can do it with static object variables initialised to new objects.
    But you can get fancy and put a static code block in the class. Just a piece of code under
    static {
      .. do some initialization

  • Book Review: A Serious Guide to OOP Design Patterns

    I've just finished reviewing a new book: AdvancED ActionSpript 3.0: Design Patterns by Ben Smith, published by Apress as part of the Adobe Learning Library
    I liked the book very much and I wanted to share my discovery with those of you who (like me) would like to bring the advantages of Object-Oriented Programming and Design Patterns to your Flash/AS3 application development efforts.
    I posted my review (“A Serious Guide to OOP Design Patterns”) on Amazon just the other day. Take a look at my review and browse through Mr. Smith's book—if you're interested.

    Nikimathew wrote:
    Every now and then I ask people if they are familiar with the book, Design Patterns: Elements of Reusable Object-Oriented Software. On such occassions, I'm often surprised to hear someone respond, "Yes, I've read it." Having spent close to three years running a study group devoted to understanding the subtleties, combinations and variations of the patterns in this book and others, I am often compelled to ask these individuals if they actually believe that the book can be "read" rather than "studied"? trolling for new members?
    three years? c'mon. i love the GoF book, but it's not holy writ. and it hasn't saved object-oriented software development.
    sounds like you need to move on to a new topic. go buy another book.
    %

  • OOP Design: controllin​g multiple (similar) devices

    Hi guys,
    We have some software that controls different kinds of "widgets." They are identicle  in function, but they are from differering vendors and have different drivers and APIs. But here's the tricky part: they may be used by themselves, or in any combination you can  think of, up to 3 at a time. 
    Currently, we use a seperate version of our software for each widget combination, duplicating a massive amount of code-  since the only thing we do with each widget is configure it, then read its data (which it continuously takes), then close it when the program is closed. The rest of the software is the same. 
    I'm wondering what the best approach would be to combine the code. I'm thinking LabVIEW Classes would be a good approach, but, I am new to OOP so I'd like some advice with the design. I've seen the example "Board Testing", that looks interesting and somewhat similar - there they use a different subclass for each board. Analogously I guess I would use a different subclass for each widget. But I'm not sure this is a good idea, since I can have various combinations of the widgets. My main class wire would then have to contain multiple sub-classes. 
    Any ideas?

    pobrepablo1 wrote:
    OK, with these comments in mind I've created an Initialize method. "Wrapper" is the name of the driver refnum.
    I'm calling this subvi with "initialize" as the argument iff First Call? is true. I think this is the best approach? Or at least simplest for me. I've never used DVRs before (except on a TV... )
    This would not be the way that I would implement this. First of all I would have explicit methods for my operations instead of implementing like the old style action engine. Also, I would store the data in the class private data, not in unitialized shift registers. I would consider using a better name than "Wrapper". It is a poor name for your data.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Tower Defense Game - OOP Design

    I'm making a tower defense game in Flash CS5 using ActionScript 3. Each object will have its own class. There is a class for towers, a class for creeps (enemies), and a class for the projectile coming from the towers. There can be multiple instances of towers, projectiles, and creeps at any time. How could I use the hitTestObject function to detect a collision between a projectile and a creep?

    I would probably create a timer that checks all the projectiles that you have on the stage and see if they are "hitting" any of the other items on the stage. This would require you to probably creating arrays for the items on the stage. I would have an enemy, tower and projectile array that stored the movie clip when it was added to the stage. So when the timer hits the handler it would cycle through the projectile array and see if it's "hitting" any of the objects in the other two arrays? Or you could probably just do a projectile array and a collision array. The collision array could contain all objects that a projectile could collide with?
    Just a thought...

  • Best practice OOP - good design

    I started to write a chat application [server + client]
    and I wanted to optimise it [good OOP + reuse of classes,objects].
    So, I have a class that handles the interface, a class that handles the socket [reading, writing], a class that handles the events, etc...
    As Iwanted to write it the best way possible, I looked a little in patterns and OOP design books in order to make it better.
    After reading, digging ..., an idea came to me.
    A problem I came across many times, in my past projects also was the fact that, when I was in the interface class, and i needed the socket class I couldn't find a way to get it and instantiate it when I needed it. I always had to pass it as an argument to the constructor of the interface class [just for this example] or in the class where i instantiate the interface class, i had to appeal a method on the object=interface in order to put the socket object in the interface class , for future manipulation.
    It could get more complicated if i wanted to use the socket object only when a certain event appear, and i wanted it in who-knows what class.
    So i trid this implementation of noname pattern [with influences from all the books I read] :
    I create an instatiator of objects [say class ObjectManager] with the following methods:
    void addObject(Object o,String nameObj)
    Object getObject(String nameObj)
    Now I instantiate [in the meanwhile i present to the user a pretty JWindow with loading...] all the objects I will use in the application and the objects-resource > [Colors, Fonts,etc...] and also add them to the ObjectManager.Also, all the objects will have a reference to this ObjectManager.
    and when I need a specific Object, I will get it with [specyfing its name]
    ObjectManager.getObject(nameObj).
    What I want from the guys from this forum:
    1) comments on this [is it good, i just go crazy, all of this is garbage, i am wrong(specify why)]...
    2) Is this a well-known pattern, or a version of a well-known pattern and I can't recognize it?
    3) If anybody understood my problem, is this the best way to achieve it[getting objects already instantiated whenever and wherever I want], and if not, which is it
    4) The problem is put wrong, an application should be thought differently - please guide me to some URLs, tutorials...
    Thanx in advance
    Gabi

    In some ways, this is similar to a Factory pattern: a place that you go to get objects.
    The difference is that a typical Factory creates (or returns from somewhere!) objects of a limited number of related types, based on some configuration input (a FooFactory, for example, doesn't typically return a Bar object, unless Bar is a subclass of or implements Foo).
    For an atypical factory, consider the java.rmi.Naming class. On the one side, a server registers the objects that it serves; on the other, a client requests those objects. As far as the client is concerned, this fits the Factory pattern exactly; on the server side, it doesn't.
    Personally, I like having a singleton "Manager" object for various semi-related objects within an application. For example, a DialogManager that holds onto all the application's dialogs. Someone has to know about them, and it could be the application's main class, but that tends to more clutter than I like.

  • Large App Design Class Structure - OOP or MVC?

    Helloooo Everyone!!
    I used flash a few years ago and am now getting into as3, I began watching hours of as3 tutorials and training in preparation to build a web app with multi user access and the structure of the design is a bit beyond my skills and need help please.
    My problem: I can design well in flash, love the graphic design tools and can draw the screens the way i want my app to look; i can build different library components and fla's and set up the project files.
    I best give a brief explanation of the system i want to design.....
    I am building an app, where different business types all work together on properties, repair projects and associated property data.
    For example a property owner owns a property, an agent runs the property for the owner and finds a tenant to live in the flat, the tenant who lives in the flat will use the online facility to tell the agent about repairs needed, or pay rent online, or check diary events such as when he needs to renew his tenancy or insurance. The repair the tenant requests will be authorised by the agent and a tradesman will then have to interact with the repair details and provide a quote or just carry out emergency work.
    First dilemma... Do i use MVC Architecture Or Object Oriented programming with custom classes.
         I was planning on the latter - OOP
         I cant quite get my head around how to think about structuring the folders and classes???
    For example. Do i build a class for 'Property' a class for 'projects' a class for 'project tasks' etc
    Is it that you think about Admin for example and build a class for invoices, a class for quotes.
    Different users will access the same property but see different information relavent to them only
    Could someone please mentor me through the design process? You can see the flash design at www.milesquicker.com/projectplanning
    I would be eernally grateful
    Miles

    MVC is an OOP Design Pattern.
    For a program like this i wouldn't use the MVC design pattern.
    I will probably create a class for each section in my application.
    Design Patterns are an advanced topic of OOP and i dought that you will be able to master it after watching
    a few tutorials, same goes for OOP. If you are just starting with programing i would suggest you to start with procedural programming
    and when you feel comfortable with that you can get into OOP although for an application like yours OOP will be the best solution.
    I dont know anything about your programming skills but the pull of an application like that they got to be really good.
    I would also suggest that you will look into flash and mysql because you will have to create databases that will hold the information.

  • Good resources for Best OOP Practices?

    As my coworkers and I dip our toes into OOP, we're looking for best practices/guidelines to follow.
    We already took the basic OOP course from NI and watched a few intro presentations.
    What are some other guides, documents, or books people can recommend for solid OOP design practices? LabVIEW-specific guides are especially appreciated, as none of us have a strong CS background. But anything will help.
    Thanks.
    http://linkd.in/mikele

    Unfortunately there is a simple check list you can employ. OO programming is somewhat an art and there are many ways to solve the same problem. Some are obviously better than others but you can find multiple ways of doing the same thing. A few things to consider is that when using inheritance your child classes should always be more specific than it's predecessor. Avoid adding methods or class data to a parent which is only used by some of the children. Generally everything in the parent should apply equally to all children. Don't be scared off of using inheritance. It is quite powerful when used correctly. Prior to coding use something like UML to define your classes. It is generally easy to see if you are heading in the wrong direction when the classes are placed on paper and you see the relationships between objects and how they are used.If you find yourself repeating some functionality inside multiple classes you may want to consider creating a new class and create a HAS-A relationship between the classes. It is perfectly acceptable to have classes contain other classes. Speaking of HAS-A think about the relationship between classes. Identify the distinction between a HAS-A relationship and an IS-A relationship. IS-A will drvie your inheritance. HAS-A will build your library of reuseable code.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • CS 5.5 How to insert header into pre-fab design --- from a sophomoric neophyte

    CS 5.5 How to insert header into pre-fab design --- from a sophomoric neophyte
    Essentially, I have one basic HTML class from several years ago, and a beginning DW class in 2008.
    i am trying to figure out if I can insert a header or otherwise edit the top of this pre-fab DW site.
    http://www.doyle.thibert.com/neos/index.html
    Thanks in advance for your sage advice.
    Doyle

    Learn all you can about HTML and CSS first.  DW expects you to know coding fundamentals. 
    HTML, CSS & Web Design Theory Tutorials -
    http://w3schools.com/
    http://www.csstutorial.net/
    http://phrogz.net/css/HowToDevelopWithCSS.html
    http://webdesign.tutsplus.com/sessions/web-design-theory/
    Then work through David Powers' 5-part tutorial
    Creating  your first web site in DW -
    http://www.adobe.com/devnet/dreamweaver/articles/first_website_pt1.html
    Good luck!
    ❄  ☃  ❄Nancy O.

  • A general OOP question

    Hi
    I have a general OOP design question, and am wondering if someone could relate an answer to the following design?
    I have a class called MediaFolderImport(); - it's designed to build a window with various editing tools in it.
    Within it's constructor, I'm calling a bunch of functions to build the window...
       createTitle();
       createInstructions();
       createToolPanel();
       createDataGrid ();
       createOpen();
       createSave();
    In my document class, I instantiate it...
    public var File_Folder_Import:MediaFolderImport=new MediaFolderImport();
    and then...
    addChild(File_Folder_Import);
    Voila! - the window appears. I WAS very proud of myself.
    Now I want to access something inside the window.  Specifically, there's a radio button that was created in createToolPanel(); - I want to update it to be selected or not selected when I receieve the user's preference from an xml settings file at start up (xml is loaded into the doc class).
    General question:
    What is the best practice, smart way to have designed this?
    - call createToolPanel(); from the doc class instead of within MediaFolderImport();, and somehow (magically) have access to the radio button?
    - leave the design as is, but add some sort of listener within MediaFolderImport that listens for changes to the xml in the doc class, and updates accordingly?
    - do it the way I'm trying to, ie try to access the radio button directly from the doc class (which isn't working):
    File_Folder_Import.myRadioButton.selected = true;
    - a better way someone can briefly explain the concept of?
    Another way to explain my design is...
    - a bunch of different windows, each created by a different class
    - xml file loads preferences, which need to be applied to different tools (radio buttons, check boxes, text fields etc) in the different windows
    I read a lot of posts that talk about how public vars are mostly bad practice.  So if you are making your class vars private, what is the best way to do the kind of inter-class communicating I'm talking about here?
    I think someone throwing light on this will help me solidify my understanding of OOP.
    Thank you for your time and help.

    You're already very used to using properties for the built-in AS classes and that's the best practice means of configuring your class. It's a "state" that you want to simply expose. The get/set method moccamaximum mentioned is the ideal route.
    The main reason you want to use get/set functions is validation. You want your class to act properly if you send an invalid value. Especially if anyone else besides yourself is going to use the class. Plan for the worst.
    The general concept is, make a private variable for any 'state' you want to remember using an underscore in the variable name to easily identify it as a private var, then make get/set functions with the same name with any required validation without the underscore.
    e.g.
    package
         public class MyClass
              // property called 'mode' to track something with an int
               private var _mode:int = 0;
              public function MyClass() {} // empty constructor
              // get (type enforced)
              public function get mode():int { return mode; }
              // set, requiring a value
              public function set isChecked(modeVal:int):void
                   // if no value is sent, ignore
                   if (!modeVal) { return; }
                   _mode = modeVal;
    Your validation will go a long way to easily debugging your classes as they grow in size. Eventually they should throw exceptions and errors if they're not valid. Then you will be best practice. Do note that if your validation requires quite a bit of logic it's common to upgrade the property to a public method. get/set should be reserved for simple properties.

  • DREAMWEAVER CS4 LAYOUT (DESIGNED IN PHOTOSHOP)..

    Hi everyone,
    Just wondering if anyone can help me with this... checkout this website of mine (Im a guitar teacher) http://www.jlgtuition.com
    (jpeg exported from photoshop used as background design) click here advice on how to lay this out again (site needs updated flash links dont work on android tablets/phones etc...)  If I were to go for the same layout and design would it be best to slice it in photoshop and uss CSS for the layout (using divs) OR maybe as I had tried without much success use divs in CSS and draw (as in the old way) layers and place text that way...  Problem there was in iexplore it jumps to the left compared to firefox where text was staying static...it needs to expand with the various browers.  Also was looking rough on iphones as well which I presume were using Safari...? 
    What do yo think is the best solution..Im not great with CSS and prefer (if I can) to use Design option in DW to layout the pages in DW...  Any help much appreciated...
    Cheers  James

    There's a lot of really bad information on YouTube.  You get what you pay for. 
    You're right about tables.  That's the old school way of doing things.  Responsive Web Design is all based on CSS Media Queries -- different layouts for different screen widths (mobile, tablet & desktops).
    Start learning CSS and it's relationship to HTML.  Coding skills are essential.   Bookmark these sites.
    http://www.html.net/
    http://w3schools.com/
    http://www.csstutorial.net/
    http://phrogz.net/css/HowToDevelopWithCSS.html
    http://webdesign.tutsplus.com/sessions/web-design-theory/
    Creating  your first web site in DW CC-
    http://www.adobe.com/devnet/dreamweaver/articles/CS6/first_website_pt1.html
    Introduction to CSS Media Queries
    http://www.adobe.com/devnet/dreamweaver/articles/introducing-media-queries.html
    Nancy O.

  • Facade design pattern example?

    Can someone point me to a LabVIEW example of this OOP design? I am learning OOP in LabVIEW and my task is to create an example program using the facade design pattern. I can't find an example to study.
    Solved!
    Go to Solution.

    I'm interested, too, so I posted a link to your question on LAVA.  There are a lot of discussions of this sort over there.
    Jim
    You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice

  • Hello I am A web design student and I am new to this but I am stuck on my first site so here it is

    Create an HTML document named ContactUs.html using the following elements:
    An XML version element placed above t
    he Document Type Definition (DTD)
    o
    version: 1.0
    o
    encoding: iso-8859-1
    Document Type Declaration for XHTML 1.0 Frameset
    <html> element
    <head> element
    o
    containing a <title> element for:
    Online News, Inc
    CONTACT US
    o
    containing a <base> element with target: main_nav
    <frameset> element in place of a <body> element with two rows
    o
    rows: 35, *
    3.
    Within the <frameset> element, create one <frame> element for the main navigation.
    src: MainNav.html
    scrolling: no
    noresize: noresize
    name: main_nav
    4.
    Within the <frameset>
    element, nest a second <frameset> element with two columns.
    cols: 150, *
    5.
    Within the nested <frameset> element, create two more <frame> elements for the left and right
    columns.
    The <frame> left column will be used for subnavigation.
    o
    src: SubNav.html
    o
    name: sub_nav
    The <frame> right column will display the General Feedback form by default.
    o
    src: GenFeedback.html
    o
    name: form_area
    6.
    Below the nested <frameset> element, create a <noframes> element for browsers that do not
    support frames. Within the <noframes> element
    , place a body tag and the following text:
    This site must be viewed by a browser supporting the "Frames" technology. Please
    upgrade your browser to view this Web site.
    So every time I follow these instructions my page is looking nothing like my instructors. What would be the right way to write this?

    This site must be viewed by a browser supporting the "Frames" technology. Please
    upgrade your browser to view this Web site.
    This just underscores how woefully outdated the syllabus is.   My advice is to do some online courses.  At  least you'll be learning how to build sites to modern standards.
    HTML, CSS & Web Design Theory Tutorials -
    http://www.html.net/
    http://w3schools.com/
    http://www.csstutorial.net/
    http://phrogz.net/css/HowToDevelopWithCSS.html
    http://webdesign.tutsplus.com/sessions/web-design-theory/
    http://www.lynda.com (video training).
    Nancy O.

  • Motion design philosophy, do's/don'ts or something...?

    Our very gifted print graphic designer is learning After Effects to create a short motion design video of one of our youthful brochures. She's asked me to try and track down a book or video series that shares some kind of motion design philosophy. Not tech tutorials, as she has plenty of those, but something from a gifted motion designer sharing their expertise in creating compelling motion design. Any thoughts?

    This book is good for motion graphics design theory and such:
    http://www.angietaylor.co.uk/2012/10/17/design-essentials/

  • JFrame Design Question

    Folks,
    I'm creating a Java App using swing and had a quick question. Does it make more sense when creating a frame to extend the JFrame class or to create a new JFrame object in the constructor of the class that will provide the gui? I don't need to extend any other classed by this gui class so I'm not worried about that but rather what makes sense from a strictly OOP design viewpoint? By extending the JFrame class I should be creating a more specific JFrame class. However, I'm not really adding any functionality (technically), I'm just painting some objects. Thanks for your input.
    Andreas

    I can think of a couple options:
    1) Let IconFrame's constructor accept a Test parameter, instead of creating an interface.
    2) Make IconFrame into a modal dialog & have it store the user's selection in a variable. Then when you show the dialog, your action listener will block until the user selects an icon. Then you can call "getSelectedIcon()" to retrieve his/her selection. This would be much like the JOptionPane.showXXX() methods, and probably the cleaner solution.

Maybe you are looking for

  • How to get Changed fields in Sales order to create a report

    Dear Gurus, How to get the log from sales order for the change of particular field. In my scenario, If an user remove the delivery block from sales order I want to capture the date on which this delivery block is removed and by whom (User)? I know th

  • XCelsius 2008 is not backward compatible with ver 4.5

    Post Author: Joseph CA Forum: Xcelsius and Live Office I tried opening a project that was done with ver 4.5 but it just said that "Crystal Xcelsius is unable to load this file. This file may be corrupt or may have features that cannot be supported by

  • Currency conversion issue while creating PO from Shopping cart

    Hello Experts, I'm facing an issue in SRM during Limit purchase order creation from Limit shopping cart. Scenario: Shopping cart was created on 1st of June and Approved on 20th June & Po was created on the same day. But the currency conversion is no

  • 10G Database install on Linux 64bit File system Vs. Automatic Storage

    Hi, I'm installing Oracle 10G on a Dell 2950 server with an Intel 64 bit processor. The operating system is Red Hat Linux 4. It has a hardware RAID. I've downloaded the Install Guide but I have a question about installing. I'm confused about the File

  • AR 9.1.0 and IE 7.0 error

    Whenever I try to click a PDF link to open it up in a browser, I get this error message: "The Adobe Acrobat/Reader that is running can not be used to view PDF files in Web Browser. Please Exit Adobe Acrobat/Reader and exit your Web Browser and try ag