Share a base class or to not share?

Hey,
I have entity type category and another entity type - logisitchierarchy.
From the business prespecive they have nothing in common.
From the structre prespective - they both have a tree (hierarchy structre - parent - childs) - so they share "structre functionality" like calculate path , get root and etc.
if for each i write the structre and they not share the same base, fix for the base structre - for example you discover that the best way to model tree is with addtional column for calculate-path..., will required to fix it in all "trees structre" in the application.
in addtional base class for all make it easier to share structre functionalty.
what is your opinion - does common structre (a one that required complex functuionality) are a good reason to inherit from the same class?

avihai wrote:
what is your opinion - does common structre (a one that required complex functuionality) are a good reason to inherit from the same class?Absolutely not.
If you have shared code then you can implement that as separate class which you use via composition. The form of that class can vary but it might have only static methods.
However be careful to insure that the code is in fact actually shared. If you need to add flags to define significantly different execution paths then the fact the code is similar doesn't mean it is the same. And thus it should not be shared at all.

Similar Messages

  • The definition of base class Application was not found.

    Hello:
    I have been coding in Flash Builder Burrito and publishing to my Xoom for a few weeks. All of a sudden at the end of the day I'm getting this compiler error which says:
    1017: The definition of base class Application was not found.    AppName.mxml    /AppName/src    Unknown    Flex Problem
    I sometimes hit the wrong key with I try to copy and paste and all of a sudden a new window will open for source of a default component which I never wanted to edit. I'm afraid I somehow deleted or modified the default class defnition of Application?
    I don't understand why this would come out of the blue, I was working on a function within a class that was drawing points  ... Then all off a sudden I'm getting this error and it's driving me nuts.
    I tried to reinstall FB Burrito on my Mac, but after all that work it still says the same thing. Wouldn't it replace the default class defs?
    Please help!

    Wow, some really strange behavior.
    OK, so here is what I'm going through. I reinstall, import the project and compiles.
    Then I uncomment the new section which contains the following code:
    lineStyle(1.0,0x8ea4bf);
    var line_commands:Vector.<int> = new Vector.<int>();
    line_commands.push(GraphicsPathCommand.LINE_TO, GraphicsPathCommand.LINE_TO, GraphicsPathCommand.LINE_TO, GraphicsPathCommand.LINE_TO);
    var line_coord:Vector.<Number> = new Vector.<Number>();
    line_coord.push(0,0, newW, angle, newW, (newH+angle), 0, newH);
    drawPath(line_commands, line_coord);
    I get 3 diffrent errors, which lead up to the error listed in the topic.
    At first it says that "int" isn't a valid type and it points to this line:
    var line_commands:Vector.<int> = new Vector.<int>();
    Then I take int out so the line looks like this:
    var line_commands:Vector = new Vector();
    Then it says I can't nest classes and it points to the main MXML. I go to the main MXML then the error switches to say "The definition of base class Application was not found.".
    I did figure out how to fix this with out reinstalling. I have to delete the project from my list (making sure to comment out the code above), then re-launch FB Burrito, then re-import the project and it works.
    This is way nuts! I dont understand ... am I crazy?

  • Getting Error base class BitmapAsset was not found

    I am converting a project using Away3D boomstick to the new FL11 version. I have installed the 4.5.1 SDK, dropped in the new away3d classes, added the flashplayer11_b1_playerglobal_071311.swc and now I get the following error.
    Description Resource Path Location Type
    1017: The definition of base class BitmapAsset was not found. Mercer-Molehill line 10 Flex Problem
    Any Ideas? I really need to get this working for a demo tomorrow.

    It seem the right playergloblal is not accessed. If You compile in Flash IDE make sure that ActionsScript Settinng is configure with the rigth paths.
    The SDK 4,5 has change the name of flex.swc to core.swc and others files.
    Flex 4.5 Framework Differences
    flex.swc and utilities.swc were renamed to core.swc and authoringsupport.swc
    The datavisualization.swc was split into charts.swc and advancedgrids.swc.
    Path to sdk
    I put all those SWC in a folder in C:\Program Files (x86)\Adobe\Adobe Flash CS5\Common\Configuration\ActionScript 3.0\flex_sdk\4.5\
    Flash Actionscript  settings. -> library path ->add the path till sdk
    Configure globalplayer.swc. in Flash
    in Common-Configuration/Player created a copy of FlashPlayer10_3.xml to FlashPlayer11.xml.
    <player id="FlashPlayer11" version="12" asversion="3">
       <name>Flash Player 11</name>
    Finally
    Flash Actionscript  settings. -> library path ->add path till globalplayer
    it work for me. ( tell me if I done wrong please).

  • Definition of base class ByteArrayAsset was not found

    I was able to run through the developer guide to get several simple applications going, but I'm getting stuck when trying to compile a game (using amxmlc) that uses Flex-style embeds to embed bitmap graphics.
    The error I'm seeing is this: (I've included input for completeness. I am located inside the project directory.)
    ===
    > ../flex/bin/amxmlc -default-size 320 480 -library-path engine.swc -source-path+=.  -- scripts/Main.as
    Loading configuration file /Users/jon/Desktop/iphone/flex/frameworks/air-config.xml
    scripts/MyAssets_SceneList.as(10): col: 49 Error: The definition of base class ByteArrayAsset was not found.
    (Repeats 10 times)
    ===
    As directed in the guide, I downloaded the latest Flex SDK and dragged in the contents of the iPhone packager directory. And to reiterate, I was able to get several simple applications working on my iPad, so my setup should be correct.
    Where have I gone wrong?

    I've narrowed it down further. Emebds DO work, but it's particularly an embed that leads to a ByteArrayAsset that does not. In my case, I am embedding an XML file as an octet stream.
    Any ideas? Thanks!

  • Help - error: 1017: The definition of base class CairngormEvent was not found.

    Hi.
    I've inherited someone else's flex code.  I need to make a small change re-complie and re-deploy, but the IDE (flash builder 4) keeps telling me there's an error in one of the.as files.  Here's the details:
    = Error:
    1017: The definition of base class CairngormEvent was not found.   
    = Code:
    package actionScripts.events {
        import flash.events.Event;
        import com.adobe.cairngorm.control.CairngormEvent;
        public class CairngormGeneralEvent extends CairngormEvent {    
         [etc..]
    Any ideas?
    I'm using Flash Builder 4. Any help would be much appreciated.

    check if the Cairngorm.swc is in the libs folder

  • Compilation error: "The definition of base class Application was not found."

    Hi,
    I imported my Flash Builder 4.6 project to the 4.7 pre-release version. My application use a CustomSystemManager (in order to force the loading of a "TextContainerManager", I'm using latest TextLayoutFramework 3.0.0.29).
    I had no error with previous versions (Flex SDK 4.5 and Flex SDK 4.6).
    My application is main.mxml :
    <myapp:MyApp>
    </myapp:MyApp>
    myapp/MyApp.as :
    package myapp {
              import spark.components.Application;
              [Frame(factoryClass="skyrockchat.CustomSystemManager")]
              public class MyApp extends Application {
            public function MyApp() {
              super();
    myapp/CustomSystemManager.as :
    package myapp {
              import flashx.textLayout.container.TextContainerManager;
              import mx.managers.SystemManager;
              public class CustomSystemManager extends SystemManager
                        public function CustomSystemManager()
                                  var c:Class = TextContainerManager; // force the inclusion of this class
                                  super();
    If I right click on the "Application" word and then "Open declaration", the correct class from spark.components is opened...
    I don't know if this is a bug or a side effect... ^^

    The packages of the CustomSystemManager don't seem to match:
    [Frame(factoryClass="skyrockchat.CustomSystemManager")] has "skyrockchat" as the package and another place says to put CustomSystemManager in package "myapp".
    myapp/CustomSystemManager.as :
    package myapp {
    When I changed "skyrockchat" to "myapp" the project compiled.
    -Darrell

  • Definition of base class _ not found

    Hi there!
    While exploring Flex 3 (really neat btw) and building my
    first app, I tried the following:
    public class X extends EventDispatcher {}
    This gives me a compile time error #1017: The definition of
    the base class EventDispatcher was not found.
    To compile I am simply use a .bat file, such as those used in
    the samples. Everything compiles normally without extending an
    existing class (in this case flash.events.EventDispatcher).
    Trying to change the compiler options with
    -library-path+=c:\flex\framework\libs
    resulted in the same error here (and I guess that's already a
    default setting).
    Any help would be greatly appreciated!
    Fre

    That worked :-). Thanks a lot, Deepa!
    So apparently you can make import statements below the class
    declaration (or anywhere in the code), but always before you are
    using the imported class. I got confused, as in java all import
    statements are in one place and the flash.net imports worked below
    my class declaration.

  • Can a derived class catch base class object

    can a derived class object catch a base class object
    e-g if i have a class
    class Test {
    // code
    }and
    class Test2 extends Test {
    }and lets say there is a method that return an object of Test (base class), so is it possible to write
    Test2 t=getTestObj(); // i-e subclass holding base class objectif its not.. how can we do so? so that derived class should hold base class object....

    sorry..
    here is how it goes
    i have a function a class
    public Test getObj() {
    // code
    }The constraint is that i cant change the implementation of this above function.
    Now when i call this function, it returns me a Test object. But i cant do
    Test t=getObj();because the Test class is written purely in java whereas i want to use write a new Test class that implements the same functionality [using the above given function] in JNI.
    so what i did, i created a new package [nativ] and created a class "Test" in that. But since i have to use the function that returns me Test and not "nativ.Test", so what i did, i inherited nativ.Test from "Test" so that the object might resolve the reference.
    So this is it.. that i cant modify the function and i need some way to do it.. plz reply

  • Where to put methods in a abstract base class - subclasses system

    Hi,
    I’d like to ask a question on some basic design practice.
    When there are methods which are common in some subclasses so I would like to “move them up” in the base abstract class, I would also like to make sure that the ADT concept of the base class itself is not broken. So I don’t want to have methods in the base class that are not general enough to be there. How to resolve this?
    For example I create a base abstract class Vehicle. Then I create subclasses Plane and Tanker and realize that the startEnginge() method in them is the same and in order remove the duplicated code, I can put it in Vehicle. But later there may be Bicycle or Sled subclasses which don’t need startEngine().
    In a broader sense, I would like to keep the Vehicle class as similar to the real word concept of vehicles as possible. And not evey vehicle have engine of course.
    What is the solution?
    Extending the class hierarchy by injecting another abstract class between the base and the subclasses? (e.g: VehicleWithEngine)
    I suppose I can’t use Interfaces because I need to have the common implemenations as well.
    Thanks for any comments in advance,
    lemonboston
    ps: I am a beginner and don't know the terminology, so if there are programming expression for the followings for example, I would be thankful if someone could help with this too:
    - moving common methods up in the class hierarchy
    - injecting a class in the hierarchy
    - abstract base class - subclasses system

    lemonboston wrote:
    Hi,
    I’d like to ask a question on some basic design practice.
    When there are methods which are common in some subclasses so I would like to “move them up” in the base abstract class, I would also like to make sure that the ADT concept of the base class itself is not broken. So I don’t want to have methods in the base class that are not general enough to be there. How to resolve this?
    You are talking about code.
    Instead you need to talk about the design.
    The base class represents conceptually a 'type' of something. That 'type' defines behavior. That behavior is what goes in the base class nothing else (in terms of design.)
    If you have common functionality which does not fit into the definition (design) of the 'type' then you put it in another class and use (composition) that class in the sub class.
    For example I create a base abstract class Vehicle. Then I create subclasses Plane and Tanker and realize that the startEnginge() method in them is the same and in order remove the duplicated code, I can put it in Vehicle. But later there may be Bicycle or Sled subclasses which don’t need startEngine(). No that is not how it works.
    You have specific examples of some vehicles and then you need to manage those types generically. That is the first step.
    Second step is then to determine what the exact 'type' is that you want to manage. And you use the requirements of the need to create the 'type'.
    Then you look at the specific examples to determine how they will meet the needs of the type.
    Thus if I have an application that must start the engines of all the vehicles in the city then I must have a vehicle class which has startEngine.
    But if I have an application that manages vehicles as inventory (like a retail store) and then decide that because my examples both have engines that I might as well move it into the base class. In that case there is no 'need' for the application to manage starting vehicles. The fact that both have engines is irrelevant.
    So looking back at your example you have stated functionality about your specific types but you have not stated anything about why your application needs to deal with that functionality generically.
    Another way to think about it is that you do not put the shared functionality in the base because you can but rather because you must.

  • How to extends base class???

    Hi here I want to extend GoogleApiKeyStore. I am sure that this class is availabe, because when I  writing to import this class flash showing this classname in hint dialogue box. but when i make object of mykey in my document class then it shows error: The definition of base class GoogleApiKeyStore was not found.
    package code {
              import be.boulevart.google.apicore.GoogleApiKeyStore
              public class mykey extends GoogleApiKeyStore{
                        public static const API_KEY : String = "xxxxxxxxxxxxxxxxxxxxxxxx"
                        public function mykey() {
                                  // constructor code

    download and save the class to make it local.

  • [svn] 3873: Modify asdoc tool to show DefaultProperty and SkinStates, if defined on base classes.

    Revision: 3873
    Author: [email protected]
    Date: 2008-10-24 09:42:17 -0700 (Fri, 24 Oct 2008)
    Log Message:
    Modify asdoc tool to show DefaultProperty and SkinStates, if defined on base classes.
    QE Notes: None
    Doc Notes: None
    Reviewer: Paul
    Bugs: SDK-17719 - FxList is missing a description of 'Skinning the Component' and its default MXML property in ASDoc.
    tests: checkintests
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-17719
    Modified Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/ASDocExtension.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/ClassTable.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/lang/StandardDefs.java

    ls -l /var/run/lighttpd/
    And how are you spawning the php instances? I don't see that in the daemons array anywhere.
    EDIT: It looks like the info in that page is no longer using pre-spawned instances, but lighttpd adaptive-spawn. The documentation has been made inconsistent it looks like.
    You will note that with pre-spawned information, the config looks different[1].
    You need to do one or the other, not both (eg. choose adaptive-spawn, or pre-spawn..not both).
    [1]: http://wiki.archlinux.org/index.php?tit … oldid=8051 "change"

  • Error while extending a controller:not a valid base class for this operatn

    Hi,
    I tried to extend a controller. but the Jdev shows an error "oracle.apps.ar.Creditmgt.application.webui.OCMAddFinDataCO is not a valid base class for this operation. Can you please let me know why is Jdev not allowing me to create a new class.
    Thanks,
    Prakash

    Yes I did. the class file exists in the Myclasses of Jdev in Jdevbin.Prakash myclasses folder is in \$JDEV_USER_HOME\jdevhome\jdev\myclasses.
    Not in jdevbin.
    Check this link
    Re: Problem in creating Extended Class for Standard Controller
    Thanks
    AJ

  • Inheritance problem: base class does not see stage instances

    I'm writing a series of Search windows for an application. I create the FLA files on the stage, each has 3 simple buttons: next_btn, prev_btn, and close_btn. Those all have event listeners which call findNext(), findPrev() and closeWin() respectively. Each search window looks for different things, some with a text box and some with a combo, etc.
    So I have a base class com.search that extends Sprite and adds the eventListeners at startup (actually, on addedToStage). Like this:
    function isAddedToStage(evt:Event){
       next_btn.addEventListener("click",findNext);
       prev_btn.addEventListener("click",findPrev);
       close_btn.addEventListener("click",closeWin);
    Then I write the appropriate find functions in each derived class.
    For example, I have
    package com {
         import com.search;
         class searchText extends search {
    In my FLA file, I set the class to com.searchText.
    But when I compile and run the window, I get runtime errors:
    ReferenceError: Error #1065: Variable next_btn is not defined.
    at com::search()
    at com::searchtext()
    If I add the event listeners in the derived class rather than the base, it works fine. But that seems to defeat the purpose of inheritance, plus it infers that I won't be able to derive new classes/swfs from those derived classes.
    So the question is, how does one reference objects created on the stage from a base class of that document's class?

    Found it. After messing around with trying dynamic classes and overriden functions that returned the desired button (that worked, but was ugly.)
    Simply and silly once you know how.
    You have to explicitly reference the stage objects (or any newly declared methods or properties) in the derived class as members of "this" in the base class - so:
    class Search {
    function isAddedToStage(evt:Event){
       this.next_btn.addEventListener("click",this.findNext);
       this.prev_btn.addEventListener("click",this.findPrev);
       this.close_btn.addEventListener("click",closeWin);
    function closeWin(e:Event){
    and then create the buttons on stage in the FLA using the derived class.
    You can also declare the event handling functions in the base class as empty functions and then override them in the derived classes. Or fill in the functions in the base class to throw a runtime error, and then override - that's as close to an abstract class as you can get, I think.

  • [svn] 3921: Fix for - @inheritDoc tag not working for get/ set overrides when you only override the setter of a base class

    Revision: 3921
    Author: [email protected]
    Date: 2008-10-28 06:23:00 -0700 (Tue, 28 Oct 2008)
    Log Message:
    Fix for - @inheritDoc tag not working for get/set overrides when you only override the setter of a base class
    QE Notes: Baselines for framework test will need to be updated.
    Doc Notes: None
    Reviewer: Paul
    Bugs: SDK-17304
    tests: checkintests
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-17304
    Modified Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/ASDocExtension.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/ClassTable.java

    Revision: 3921
    Author: [email protected]
    Date: 2008-10-28 06:23:00 -0700 (Tue, 28 Oct 2008)
    Log Message:
    Fix for - @inheritDoc tag not working for get/set overrides when you only override the setter of a base class
    QE Notes: Baselines for framework test will need to be updated.
    Doc Notes: None
    Reviewer: Paul
    Bugs: SDK-17304
    tests: checkintests
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-17304
    Modified Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/ASDocExtension.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/ClassTable.java

  • Export for AS: Class vs Base Class

    when i export a movie clip for actionscript, what are the differences between Class & Base Class?  i see most tutorials change Base Class and leave Class as the name of the movie clip defined in the library.

    the main use of the base class is to extend it so many different classes can share it's functionality.
    but even when not needed as a super class, the base class is also helpful when you want to instantiate many different objects using code and you don't want to write/compile many different class files.
    if flash finds you failed to write a class file (for every class exported for actionscript), flash writes a default class files for you.

Maybe you are looking for

  • E61i no longer connects successfully

    Hi, I'm having a very frustrating problem with my E61i, which has worked perfectly with Bluetooth File Exchange, Nokia Multimedia transfer etc., but now fails to connect. It seems something is corrupted on the phone such that this no longer works. Re

  • Problems with FCP playback on external LG monitor

    I have just purchased an LG 22EA63 external monitor to use with FCP 7. Monitor connects fine, works ok with other programmes but once in FCP , when i transfer both canvas and viewer windows onto the monitor, playback in not smooth with flickering str

  • Qosmio G30-176: TV tunner issue - blurred without any sounds

    I from the seychelles and we use a Pal System similar to that in the UK, but I cannot tune the TV Tuner. It always comes out blurred without any sounds. Can somebody please help?

  • Adobe Illustrator intermittenly hanging

    User stated that this issue with Adobe Illustrator CS5 Crashing happens whether the user opens a local Illustrator file or a file via the network. User also stated this is an intermittent issue and does not happen often but lately has started to occu

  • Quicktime pro won't work on windows 7

    Hi, I've purchased/installed Quicktime Pro.  There were no issues with installation or registration of the software.  I'm unable to get Quicktime to play any of my saved movie files, .avi or .mov file.  When I click on play the slider start to progre