Questions about analysis and structured and object-oriented design

Asked

Viewed 605 times

15

Software process, involves various activities, among them, analysis and design. Among the options of methods to perform these activities, we have the structured and object-oriented. Regarding both, I have some doubts:

  • What is the main difference?
  • What are the advantages and disadvantages of using each?
  • Why the object-oriented method is used in most cases?
  • I started to try to write an additional answer, but it was getting much smaller than the existing answer. Could you explain why the existing answer is not enough?

  • 1

    @Victorstafusa It is a good answer, but I believe that it was lacking to mention some disadvantages of AOO and advantages of AE. As for the use of OO, I believe there are other reasons besides code reuse and security.

  • 1

    I will supplement my answer.

  • Done, updated response.

1 answer

13


What is the main difference?

  • In the Structured Analysis (we will call AE), the focus is mainly on the process and procedures. The main techniques used are the DFD (Data Flow Diagram), flow charts, table/decision tree and Entity-Relationship analysis. It is an old and not currently recommended practice.
  • In the Object-Oriented Analysis (call it AOO), the focus is on capturing real-world objects by contextualizing them in a scenario relevant to the problem (broadly, reproduce some real world features in a software environment). The detail is greater for the data structures and smaller (less imperative/specific) for the structure of procedures and methods. The modeling techniques use UML (which may have both structural and behavioural/procedural aspects of the system).

Particularly I relate, in a crude way, that the structured analysis is for the structured and procedural programming as object-oriented analysis is to object-oriented programming; where the AOO represents the interactions between objects of a system at the concept level, and the AE the interactions between parts of the system at a function/method level.

What are the advantages and disadvantages of using each?

  • AOO uses UML, which is more reusable and easy to maintain when compared to AE digramates;
  • AE focuses on the functionality of the program, resulting in a clearer, imperative language for the programmer. The AOO, being more declarative, may not be as clear/specific in some specifications;
  • AE uses process-oriented modeling, which makes it easier to understand the movement of data - whether by the developer or client;
  • The AOO is more efficient in large projects with a high risk of changing system requirements, while the AE is efficient for well-defined projects with stable requirements;
  • The AOO was developed to minimize the problems faced in the creation of complex software, allowing the use of object orientation - inheritance, polymorphism, composition, encapsulation, among others -, which is not available in AE;
  • The AOO is most used nowadays, which implies greater availability of documentation and information in general;
  • The AOO requires greater effort in system modeling when compared to the AE, but also less coding effort - we have here a feature that moves the complexity of the development to the analysis, which is quite debatable in the context of being an advantage or disadvantage;
  • AOO has a greater tendency to face modeling problems due to their greater complexity. A practical example, caused by the lack of knowledge of abstraction, would be the creation of a modeling that leads to the creation of similar separate implementations, contained in different classes not reusable;
  • AOO can introduce superior verbosity to AE in small projects: in some cases the use of the OO paradigm can generate more lines of code than the structured implementation. This disadvantage disappears as use cases that benefit from the OOP are added;
  • AOO offers, through OO, a facility of extension superior to AE, because the creation of new models that communicate with existing ones does not require the developer to know the internal functioning of the latter.

Why the object-oriented method is used in most cases?

I believe the main reason is because of your resemblance to the real world (objects have characteristics and can perform/undergo procedures), which makes it easier to represent it in a natural way. Also object orientation allows a code reuse very large, especially in large projects.

At the moment you define, for example, a class Usuário for your system, this can be imported/required in any other module that has access to the class. Complex use cases that require inheritance or composition can be implemented in a simple manner with OO. This implies in processes of simplified development and maintenance, since there is only one file to be changed - in addition to following an important development rule, the DRY - Don’t Repeat Yourself.

Another relevant aspect is greater security, where OO offers visibility control (public and private methods, for example), which implies allowing or preventing the use of system features in a development context. The application of that practice simplifies the software API, something especially useful in the creation of libraries and exports of the code, because the programmer who develops the client software only has knowledge and access to public methods.


Sources:

Browser other questions tagged

You are not signed in. Login or sign up in order to post.