Avatar of gudii9
gudii9Flag for United States of America asked on

domain classes vs implementation classes/solution space classes

Hi,


I was reading about domain classes vs implementation classes/solution space classes.

What are the practical uses, differences, advantages of each of them.

what is transient behaviour and what is static relation ship between classes represented in uml.
Please advise. Any ideas, resources, sample code highly appreciated. thanks in advance
Java EEJavaJSP

Avatar of undefined
Last Comment
dpearson

8/22/2022 - Mon
dpearson

what is transient behaviour and what is static relation ship between classes

A transient relationship means one that comes and goes.

For example a class like this:

public class MyList {
     private List<Object> m_List ;

     public void add(Object obj) { m_List.add(obj) ; }
     public Object get(int index) { return m_List.get(index) ; }
}

could be used to store a list of many different types of objects (e.g. a list of Strings or a list of Integers).  So it's relationship to the objects being stored is transitory - it doesn't always store Strings or Integers.

That's very different from a class like this:
public class MasterList {
       private MyList m_MyList ;
}

where the MasterList has a static relationship to the MyList class.  It will always store a MyList instance.

Does that help?

Doug
David L. Hansen

If you are fairly new to Object Oriented Programming please take a look at this article.  I'd love some feedback, if you feel so inclined to leave a comment.

Beyond that, I can give you my take on the different types of objects in question and how to use them.  First of all, recall that in database design and OO design, we try and mimic the real world (ie. We don't want to have a class or a table named "Creatures" where we place information about all of our employees, customers, and pets).  We want to give each discrete thing its own table and object.  Now that can be taken too far, remember simplicity is the goal, break down what needs to be broken down and make sure you're planning for the future (ie. we don't have customers yet, but we will...so create those tables and object for them).  That being said, sometimes you have system specific needs that need to be managed that don't exist in the real world.  For example, your program may use a dozen log files which need to be managed.  In this case, you might make a class whose job it is to manage those logs.  I currently have a class which takes in error messages and tracks them over time - that's not part of specific real-world business object like "Customers" however, it serves an important role.  A Customer class is a domain class and the log-manager is an implementation class (used when the program is implemented just to maintain the program).
ASKER
gudii9


public class MyList {
     private List<Object> m_List ;

     public void add(Object obj) { m_List.add(obj) ; }
     public Object get(int index) { return m_List.get(index) ; }
}

could be used to store a list of many different types of objects (e.g. a list of Strings or a list of Integers).  So it's relationship to the objects being stored is transitory - it doesn't always store Strings or Integers.

That's very different from a class like this:
public class MasterList {
       private MyList m_MyList ;
}

where the MasterList has a static relationship to the MyList class.  It will always store a MyList instance.

can you please elaborate on this. I am not clear on this
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
David L. Hansen

What you posted is true.  The two container classes do just as you describe.  One can only receive a specific type and the other doesn't care which type of objects go into it.  That really has nothing to do with your original question (as I see it) regarding domain classes and implementation classes (except that a collection object is built from what you might call an Implementation Class).

The question of "Domain" vs. "Implementation" Classes, deal more with your own personal categorization of your custom class.  If you build a class of "Customer" that is pretty much a clear business "domain" class.  If you build one called "Website_Launcher" that doesn't really have a lot to do with the business domain.  It's all about implementing the app.
ASKER
gudii9

I have gone through tutorial. It is interesting.

If you build a class of "Customer" that is pretty much a clear business "domain" class.  If you build one called "Website_Launcher" that doesn't really have a lot to do with the business domain.  It's all about implementing the app.

What is the relation between customer and "Website_Launcher".
I have not understood difference  between business domain and implementing app.
Please advise
ASKER CERTIFIED SOLUTION
David L. Hansen

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.