We help IT Professionals succeed at work.

domain classes vs implementation classes/solution space classes

gudii9
gudii9 asked
on
1,627 Views
Last Modified: 2013-12-10
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
Comment
Watch Question

CERTIFIED EXPERT

Commented:
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
CERTIFIED EXPERT

Commented:
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).

Author

Commented:

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
CERTIFIED EXPERT

Commented:
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.

Author

Commented:
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
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.