if i have 2 classes in my class diagram.....InboundFILght and
OutboundFlight [...] can i consider these 2 classes for
inheritance and WHY ??
Inherit both from an abstract absFlight class.
This is _not_ an XML, nor a web services question. Talk of
"inheritance" is a matter for 1980's vintage OO programming style
(read Bertrand Meyer's Eiffel book "Object-oriented Software
Construction"). Although it's a reasonable technique for this sort of
coding, it'll cause problems if you start thinking of inheritance too
much when you architect a web service.
Compare "old" OO languages to "modern" OO langauges like Java and
(yes, indeed) VB. There's a shift from the "inheritance" model to the
"interface" model. Inheritance isn't a bad model for structuring the
code internally, but it's a poor model for building the external call
interface. The need to support multiple external use-cases means that
you need to bring multiple external interfaces together. Doing this
through multiple inheritance (early C++ practice) soon showed up how
horrible MI could become.
So these days we build interfaces separately to implementation, and we
no longer tie these interfaces to our inheritance. Re-introducing this
coupling to a web services interface (by getting over-focussed on the
inheritance of *Flight classes) would definitley be a bad thing.
There are interfaces (ShowMeThePilot, IgniteShoeBomb) that apply to
both classes. There are interfaces (PredictArrivalTime) that only
apply to one. Build these separately, allow them to apply to
approriate classes, but don't start fiddling with the inheritance. For
instance you might also implement the
AirportShuttleBus:
redictArrivalTime interface, but you shouldn't
start inheriting both classes of absFlight and Bus from an invented
ancestor of absTimetabledTransportVehicle.