a top down approach code example
Example 1: top down vs bottom up approach
Top down SOAP Web services include
creating WSDL(Web Services Description Language)
document to create a
contract between the web service and
the client, with a required code as
an option. This is also known as
Contract-first approach. The top-down
approach is difficult to implement
because classes must be written to
confirm the contract defined in WSDL.
One of the benefits of this method is
that both client and server code can
be written in parallel.
Bottom up SOAP web services require
the code to be written first and then
WSDL is generated. It is also known
as Contract-last approach. Since WSDL
is created based on the code, bottom-up
approach is easy to implement and client
codes must wait for WSDL from the server
side to start working.
Example 2: top down approach
Testing takes place from top to bottom.
High-level modules are tested first and
then low-level modules and finally
integrating the low-level modules to
a high level to ensure the system is
working as intended. Stubs are used as
a temporary module if a module is
not ready for integration testing.