Universal application architecture





Surely anyone who is engaged in programming remembers how at the very beginning of the journey a stream of information about algorithms, patterns and development methods falls on him. She remembers that very feeling when, having dealt with some fresh or simply new idea for oneself, the feeling "well, now we will live!" And also that feeling of slight despair - after trying to apply all this in a real project, with real people, with sudden turns of business logic and constant β€œvery urgent”.





How is it that in a world where most projects fit into the "data entry, validation, and save to database" pattern, so many projects end up in a mess? Despite the fact that all developers are full of knowledge about algorithms, frameworks and patterns, and SOLID principles bounce off the teeth in the interview. I would venture to express on this occasion my assumption about the cause, as well as my personal way of how to deal with this.





Thesis

. , . :   , , . , , , , ( ). , "" . , β€œβ€ .





? , . , β€œβ€ , .





, - , - , , . , . . , , UI. , β€œβ€ , .. β€œβ€ β€œβ€. , : β€œ ” β€œ ” ?





, : , β€œβ€, ? , β€œβ€ - , , - .





1- .

, , : (), , ? - ? , RFC 5322, - , . " " - . , , " ?". , .. , , . , , - - . , β€œ-”. , , , . , , , .





1- : () . 





, , , , . , - - . , , . 





2- . "" ""

, ? ,  : , , β€œβ€.





: , "" ()? . , - "" , . , " , - ", " ", , - .





3- .

2 . β€œ ?” UI, , . Console.Write()



textbox.Text



html-, .





. , , , β€œ ”. , , , -, , .





, . , , , , , . , . , , , . 





: Win , , .





4 : , , , . - - β€œ ”.





, . , . , . , , , . , , , () - : β€œ ” ? , β€œβ€ , . , , , . - , , , .





, . Windows .





. - SMS . - - . 





, β€œ , ”, - - . , - .





, Client



, , IO - ClientGet(int id)



, .





, IO . ClientGet



Client. ClientVerySpecificStatsInfo



, IO . , , , , . , , , , , . , . - , , . 





,  - ( β€œβ€) β€œβ€ , " !".





, . , - - , . , , - . , , , .   . , - , - , , , , .





, , . , , MVP . - ,     - , , - β€œβ€.  , UserPresenter



, UserPrecursor



.





β€œ ” . , .. .. , - , β€œ ” - , , , .





: , UI. UI , β€œβ€ , UI. ( ) . .





. β€œ ” . β€œ ” . - . , β€œβ€ .  , , , , .





The importance of instructions

, () - . , - . , Order (), Client User. Order Line (), . , Line Order . , , , . .  





Logic.Order



Logic.Orders.Line



, Line Order - , Line Orders.





Logic.Order



Logic.Line



, Line , , . 





, β€œβ€ , β€œβ€, β€œβ€, . , , . . , , Zip, City, Address - , . , , .





:





/Geo
	Address
	City
	Zip
/Orders
	Line
Order //   "Orders"
      
      







, , : , .





, . , , , - , . , , . -. 





, . - . UML, , , , - , … … . , - Zip, Address, City - - , - - GeoObject . 





, , - . β€œ - ” - . - .Subitems



. - .Subtypes







, .





.Def

, , , - , . .Def



(Definitions). , . UML, , .





/Geo
	Address
	City
	Zip
/Orders
	/.Def
		OrderType
		OrderBase
	Line
Order
      
      



.Spec

, 1-1 . 1-1 . , , , ..   - . 





, . UML .





.Spec



- ( specification - , ), .





, User UserLikes, , / User’ .





β€œ ” . β€œβ€ , - .





. , UserStats (β€œβ€) . , , , , . , , .. , . Stats, . (, UserStats , Stats .)





:





/Users
	/.Spec
		UserLikes
		UserStats //   1- 
	Stats //   
User
      
      







. , , UML, , UML. , ,   , - .





.Calc

, , . . , . , , .. . β€œβ€ , - , 0 1 . PDF , Adobe Acrobat Reader, .  .Calc



( calculators).





, . , , , , . , β€œ - ? ?”





- , - . . .





.Models

.Models



, -, , , . , Team, ID



Name



. , , , , ”” . 2- , User , .





- , . - , , , .





  , . , presenter.Submit(input)



clientValidator.Validate(input)



, β€œ-” , .





β€œβ€ , UI β€œβ€.





 

, , , , , , .. . - . . , , Ms Excel. - UI, , . , , - Html, Pdf, Rtf, Json, Xls .





, , . 





.Tech



, , . , , - - . , , , , . β€œ ” , , , .





, . , , β€œβ€ .. .Dev



. IO , .





, , - ? Money? ? , , Options? - , Context - MoneyContext, OptionsContext ..





MVC, MVP, MVVM

MVC, MVP MVVM , .. ( ) . , , , β€œβ€ - . , , . - .





, , - . . , . , β€œ !”, . β€œ ”, β€œ ”, β€œ ”. , - . 





, β€œβ€ -   β€œβ€. - , - - ( , ), .





, , β€œ ?”. . , β€œβ€ . , - .





, , , - . , , , - , - . , - , "" . , .





p.s. C !








All Articles