Except for the context of UML,if A extends B,then B is a subset of A.
But in UML, it's the opposite,say,if A extends B,then A is a subset of B,
why is it so strange?
Except for the context of UML,if A extends B,then B is a subset of A.
But in UML, it's the opposite,say,if A extends B,then A is a subset of B,
why is it so strange?
To write it in terms of use cases (I believe this is context you meant - if not, correct me), lest think about ordering a meal in your favorite fast food restaurant.
Basic use case is to order a meal, but it can be extended if you present a discount coupon. Every time you go trough this use cale, you get a meal, but only under special circumstances you pay less than usually (or get an extra sandwich).
I found quite a good example here: http://www.agilemodeling.com/essays/useCaseReuse.htm. As you can see enrolment for international student includes additional security check, and is applied only to a subset of enrollments. Hope that will help more.
UML doesn't use the term "to extend/extension". Instead, it uses the term "to generalize/generalization"; people also often refer to it as "to inherit/inheritance".
If B is a generalization of A (i.e. A inherits from B), then A is a subset of B. This should become clear from the "is-a" relationship: if every A is a B, then A is clearly a subset of B. In your terminology, if A extends B, A is a subset of B.
A type is a predicate: for every object, you can determine whether it belongs to the predicate. Extending the predicate means to make it more restrictive.