|
1 | 1 | <sub>**This work is being done as part of the Course Deisgn patterns on <strong>Ruby</strong> **</sub>
|
2 | 2 | # Design-patterns
|
| 3 | +<h4>Map</h4> |
3 | 4 | <p>
|
4 |
| -<a href="https://github.com/StrongerProgrammer7/Design-patterns#-introduction-with-ruby---1lab">Introduction with Ruby</a></br> |
5 |
| -<h5>Kernel classes and models</h5> |
6 |
| -  <a href="https://github.com/StrongerProgrammer7/Design-patterns#1ex-object-and-clesses">Object and clesses<a/> |
7 |
| -  <a href="https://github.com/StrongerProgrammer7/Design-patterns#2ex-reading-view-record-entity">Reading, view, record entity<a/> |
8 |
| - |
9 |
| -</p> |
10 |
| -<div> |
11 |
| -<h3> Introduction with Ruby - 1lab</h3> |
12 |
| -<p>1 Task: <br/><pre> |
13 |
| - 1. Hello world |
14 |
| - 2. Accept the username as a program argument.Say hello to the user using string formatting. |
15 |
| -    Ask what language is the user's favorite, in case it is ruby, answer that the user is |
16 |
| -     a sucker, otherwise be sure to answer that soon it will be ruby and put |
17 |
| -      different comments for several languages. |
18 |
| - 3. Ask user enter ruby language command and OS command. Execute ruby and OS command</pre> |
19 |
| -</p> |
20 |
| -<p> 2 Task:<br/><pre> |
21 |
| - 1. Find the sum of prime divisors of a number. |
22 |
| - 2. Find the number of odd digits of a number greater than 3 |
23 |
| - 3. Find the multiple of such divisors of a number, the sum of the digits less than |
24 |
| -    the sum of the digits of the original number. |
25 |
| -</pre></p> |
26 |
| -<p> 3 Task:<br/><pre> |
27 |
| - 1. Write methods that find the minimum, elements, number of the first positive element. |
28 |
| -     Each operation in a separate method. Solve the problem using loops (for and while) |
29 |
| - 2. Write a program that takes two values as an argument. The first |
30 |
| -    value tells which of the methods of task 1 to execute, the second one |
31 |
| -      tells where to read the list from where the file address should be written |
32 |
| -        as an argument. Next, you need to read the array and execute the method. |
33 |
| -</pre></p> |
34 |
| -<p> 4 Task:<br/><pre> |
35 |
| - 1. Given an integer array. It is necessary to find the number of emails located after |
36 |
| -  the last max |
37 |
| - 2. Given an integer array. It is necessary to place the elements, located |
38 |
| -    before the min, at the end of the array |
39 |
| - 3. An integer array and an interval (a,b) are given. Need to find the max of the elements |
40 |
| -    in this interval |
41 |
| - 4. Given an integer array. Output indexes of el-in, which are less than its left |
42 |
| -    neighbor, and the number of such numbers |
43 |
| - 5. For the given list + numbers, construct a list of all + prime divisors |
44 |
| -    of the e-list without repetitions |
45 |
| -</pre></p> |
46 |
| -</div> |
47 |
| -<h3> Kernel classes and models - 2lab</h3> |
48 |
| -<div> |
49 |
| -<p><h4>1Ex Object and clesses:</h4> <br/><pre> |
50 |
| - 1. Create the Student class in a separate file with the object fields ID, Last Name, |
51 |
| -  First Name, Middle Name, Phone, Telegram, Mail, Git. Full name is required, others are not. |
52 |
| -   Write a constructor, write a getter and a setter for each field, |
53 |
| -    when naming methods it is MANDATORY to use ruby naming conventions. |
54 |
| - 2. Create several objects from a separate main.rb file and display information about them |
55 |
| -  on the screen. Think over the correct way to display information about the current state of |
56 |
| -   the object on the screen, modify the class. |
57 |
| - 3. Avoid code duplication in constructor, getter and setter. |
58 |
| - 4. Use attributes to concisely write getters and setters. |
59 |
| - 5. Provide in the constructor the ability to create objects with any combination of |
60 |
| -   filling in optional fields. |
61 |
| - 6. Add a CLASS method that checks if some string is a phone number. Modify the class |
62 |
| -  so that at an arbitrary point in time there could not be an object with an invalid |
63 |
| -   string in the phone number field, for this you will have to modify the constructors. |
64 |
| -    Test the resulting class. |
65 |
| - 7. Create validations for the correct form of the string in the remaining fields. |
66 |
| - 8. Write a validate method that performs two validations of the presence of the |
67 |
| -   git and the presence of any contact for communication, if possible separate the methods. |
68 |
| - 9.Write a set_contacts method that sets the value of a field or fields for the entered contacts. |
69 |
| - 10. Start building a class diagram by describing this class.</pre> |
| 5 | +<a href="">Introduction with Ruby</a></br> |
| 6 | +<a href="">Kernel classes and models</a> <i> Pattern Strategy</i></br> |
| 7 | +<a href="">Single Entity Model</a> <i> Pattern: Singleton && Adapter && MVC && Observer</i></br> |
| 8 | +<a href="">Introduction with Ruby</a></br> |
| 9 | +<a href="">Introduction with Ruby</a></br> |
| 10 | +<a href="">Introduction with Ruby</a></br> |
| 11 | +<a href="">Introduction with Ruby</a></br> |
70 | 12 | </p>
|
71 |
| -<p><h4>2Ex Reading, view, record entity:</h4> <br/><pre> |
72 |
| - 1. Think about the structure of String representation of the class object,coordinate it |
73 |
| -  with clause 2. Write a separate constructor accepting a string as an input, |
74 |
| -   which parses this parses the string and calls the standard constructor with |
75 |
| -    arses this string and calls the standard constructor with the parameters. |
76 |
| -     Test the constructor from the main class. |
77 |
| - 2. Design an exception structure for the given constructor |
78 |
| -  constructor in case parsing of the string is impossible and in case the data in the |
79 |
| -   string didn't pass validation. if the data in the string is not validated. 3. |
80 |
| - 3. Write a getInfo method that returns brief |
81 |
| -  information about the student - Surname and Initials; git, communication |
82 |
| -   (specify any means of communication and state what it is) on ONE line. If possible, |
83 |
| -    divide the method into components (in the future this information will be displayed in |
84 |
| -     table and you will have to take it in parts). |
85 |
| - 4. Write Student_short class that has 4 ID fields, |
86 |
| -  Surname and initials, Git, Contact. The fields can't be edit. There are two possible |
87 |
| -   constructors - one of them is an object of class Student.Student class object, the other |
88 |
| -    has an ID and a string that contains and a string that contains all other information. |
89 |
| - 5. Refactoring by separating the superclass and removing code duplication in the Student |
90 |
| -  and Student_short classes. |
91 |
| - 6. Mark the changes in the class diagram. |
92 |
| - 7. Write a read_from_txt method that receives file address arguments, throws an exception with |
93 |
| -  notification if the address is invalid, and returns an array of Student type objects. |
94 |
| - 8. Test the method by outputting a brief output of information about each object. |
95 |
| - 9. Write a write_to_txt method that receives as address, name of a file, and a list of objects |
96 |
| -  of type Student. |
97 |
| - 10. Test the compatibility of these methods. |
98 |
| -</pre></p> |
99 |
| -</div> |
| 13 | + |
| 14 | + <h3> Content: </h3> |
| 15 | + [<i>Introduction with Ruby</i>](https://github.com/StrongerProgrammer7/Design-patterns/files/11524651/1_._2022-2023.pdf) |
| 16 | + <ul> |
| 17 | + <li>Introduction to Ruby</li> |
| 18 | + <li>Algorithms for working with numbers and loops</li> |
| 19 | + <li>Arrays</li> |
| 20 | + <li>Methods that take a block as an argument</li> |
| 21 | + </ul> |
| 22 | + [<i>Kernel classes and models</i>](https://github.com/StrongerProgrammer7/Design-patterns/files/11524661/2_._2022-2023.pdf) |
| 23 | + <h4>Using pattern Strategy</h4> |
| 24 | + <ul> |
| 25 | + <li>Objects and classes</li> |
| 26 | + <li>Reading, Viewing, and Writing Entities</li> |
| 27 | + <li>Model classes.</li> |
| 28 | + <li>Classes: JSON,YAML,TXT <strong>(pattern Strategy)</strong></li> |
| 29 | + </ul> |
| 30 | + [<i>Single Entity Model</i>](https://github.com/StrongerProgrammer7/Design-patterns/files/11524667/3_._2022-2023.pdf) |
| 31 | + <h4>Using pattern Singleton && Adapter && MVC && Observer</h4> |
| 32 | + <ul> |
| 33 | + <li>Connecting a database to a model (pattern Singleton)</li> |
| 34 | + <li>Serialization (pattern Adapter) </li> |
| 35 | + <li>Building a window.(pattern MVC)</li> |
| 36 | + <li>MVC – CRUD - read. (pattern Observer - View)</li> |
| 37 | + </ul> |
| 38 | + <ul> |
| 39 | + <li></li> |
| 40 | + <li></li> |
| 41 | + <li></li> |
| 42 | + <li></li> |
| 43 | + </ul> |
| 44 | + <ul> |
| 45 | + <li></li> |
| 46 | + <li></li> |
| 47 | + <li></li> |
| 48 | + <li></li> |
| 49 | + </ul> |
| 50 | + <ul> |
| 51 | + <li></li> |
| 52 | + <li></li> |
| 53 | + <li></li> |
| 54 | + <li></li> |
| 55 | + </ul> |
| 56 | + <ul> |
| 57 | + <li></li> |
| 58 | + <li></li> |
| 59 | + <li></li> |
| 60 | + <li></li> |
| 61 | + </ul> |
| 62 | + <ul> |
| 63 | + <li></li> |
| 64 | + <li></li> |
| 65 | + <li></li> |
| 66 | + <li></li> |
| 67 | + </ul> |
| 68 | + <ul> |
| 69 | + <li></li> |
| 70 | + <li></li> |
| 71 | + <li></li> |
| 72 | + <li></li> |
| 73 | + </ul> |
| 74 | + |
| 75 | + |
| 76 | + |
0 commit comments