-oriented structure:
Figure 1
Background 1: The company is a gold partner of Ford and Honda, and now requires the development of a self-driving system, as long as the system is installed on the car to achieve self-driving, the system can be used in Ford and Honda cars, as long as the two brands of cars use the system to achieve automatic driving. So someone made an analysis.
Figure 1: We define an autosystem class, a fordcar class, And a hon
Honda vehicles, as long as the two brands of cars use the system to achieve autonomous driving. So someone made an analysis of one. For graph One analysis: We define a Autosystem class, a Fordcar class, and a Hondacar class. There are three methods in the Fordcar class and the Hondacar class: Run (Start car), Turn (Turn car), stop (stop car), of course, a car certainly more than these features, as long as you can explain the problem. The
and Class C are low-layer modules that are responsible for basic atomic operations, and if Class A is modified, it poses unnecessary risks to the program.The Autosystem class is directly dependent on the Hondacar and Fordcar two classes, resulting in a high coupling, autosystem classes want to manipulate Hondacar or fordcar must create the corresponding object directly. Modify: Modify Class A to dependent
dependent on abstraction. This is the most difficult to understand, usually in the framework of the project to use, for example, the business logic layer is a high-level module relative to the data layer, because the business logic layer needs to call the data layer to connect to the database, but to achieve scalable high-reuse, try not to let the business logic layer depends on the data layer, An interface can be abstracted from the data layer, allowing the business logic layer to rely on this
, it poses unnecessary risks to the program.
The Autosystem class is directly dependent on the Hondacar and Fordcar two classes, resulting in a high coupling, autosystem classes want to manipulate Hondacar or fordcar must create the corresponding object directly.
Modify: Modify Class A to dependent interface I, Class B and Class C each implement interface I, Class A through interface I indirectly with C
abstraction.
This is the most difficult to understand, usually in the framework of the project to use, for example, the business logic layer is a high-level module relative to the data layer, because the business logic layer needs to call the data layer to connect to the database, but to achieve scalable high-reuse, try not to let the business logic layer depends on the data layer, An interface can be abstracted from the data layer, allowing the business logic layer to rely on this abstract int
logic; Class B and Class C are low-level modules responsible for basic atomic operations; if class A is modified, it brings unnecessary risks to the program.
The AutoSystem class directly depends on the HondaCar and FordCar classes, which produces a high coupling. to control the HondaCar or FordCar class, you must directly create the corresponding object.
Modify: Change Class A to dependent interface I. Class B and Class C implement interface I. Cla
is generally used when a project framework is built. For example, the business logic layer is a high-level module relative to the data layer, because the business logic layer needs to call the data layer to connect to the database, but to achieve high scalability and reuse, try not to make the business logic layer dependent on the data layer. You can abstract an interface at the data layer, make the business logic layer dependent on this abstract interface.
Scenario: Class A (high-level module)
(); } } Public voidTurncar () {if(Type = =Cartype.honda) {Hondacar.turn (); } Else if(Type = =Cartype.ford) {Fordcar.turn (); } } }At present, is to meet the demand, but with the development of business is also developing, now if the development of partners, the need for other brands of cars to add automatic driving system, such as red Flag, Chery and other brands, then if the previous way, you need to modify the Autosyst
Jeepcar; PublicAutosystem (Jeepcar jeepcar) { This. Jeepcar =Jeepcar; } Public voidRuncar () {jeepcar.run (); } Public voidStopcar () {jeepcar.stop (); }}Client Package com.csdhsm.designpattem.dependence; Public class Solution { publicstaticvoid main (string[] args) { New Jeepcar (); New Autosystem (jeepcar); System.runcar (); System.stopcar (); }}Obviously, the demand is satisfied, but s
": r
Cacls "C: \ WINDOWS \ Microsoft. NET \ Framework \ v1.1.4322 \ Temporary ASP. NET Files"/e/t/p "network service": f
Cacls "C: \ WINDOWS \ Microsoft. NET \ Framework \ v2.0.50727 \ Temporary ASP. NET Files"/e/t/p "network service": f
Cacls c: \ windows \ system32/e/g "network service": r
Cacls c: \ windows \ system32 \ rasapi32.dll/e/g "network service": r
Echo y | cacls.exe C: \ WINDOWS \ system32 \ inetsrv \ adsiis. dll/p Administrators: f autosystem
need to apply autonomous driving system of the car, all inherit this interface, implement different strategy algorithm. Then design the automatic driving environment class, to maintain the automobile instance.2.3 Design Architecture Diagram2.4 Program source code download http://download.csdn.net/detail/clevercode/87003492.5 Program Description1) strategy.php2) strategypattern.php3 Summary 1) in strategy.php and strategypattern.php. If you need to extend multiple automotive application autopilo
= ' RRR ';To view the user's default tablespace:Select Default_tablespace from dba_users where username= ' SCOTT ';Delete a table space while deleting a data fileDrop tablespace RRR including contents and datafiles; Be carefulDesc dba_tablespaces;Select Tablespace_name,extent_management,allocation_type,segment_space_management from Dba_tablespaces order by 1;Sql> Select Tablespace_name,extent_management,allocation_type,segment_space_management from Dba_tabLespaces ORDER by 1;Tablespace_name Ext
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.