-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdto.html
260 lines (215 loc) · 10.7 KB
/
dto.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<title>Blog - Flutter31 Bootstrap Template</title>
<meta content="" name="description">
<meta content="" name="keywords">
<!-- Favicons -->
<link href="assets/img/favicon.png" rel="icon">
<link href="assets/img/apple-touch-icon.png" rel="apple-touch-icon">
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i|Nunito:300,300i,400,400i,600,600i,700,700i|Poppins:300,300i,400,400i,500,500i,600,600i,700,700i" rel="stylesheet">
<!-- Vendor CSS Files -->
<link href="assets/vendor/aos/aos.css" rel="stylesheet">
<link href="assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="assets/vendor/bootstrap-icons/bootstrap-icons.css" rel="stylesheet">
<link href="assets/vendor/glightbox/css/glightbox.min.css" rel="stylesheet">
<link href="assets/vendor/remixicon/remixicon.css" rel="stylesheet">
<link href="assets/vendor/swiper/swiper-bundle.min.css" rel="stylesheet">
<!-- Template Main CSS File -->
<link href="assets/css/style.css" rel="stylesheet">
<!-- t-montes code-viewer -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/highlight.min.js"></script>
<script type="module" src="https://cdn.jsdelivr.net/gh/t-montes/code-viewer@master/versions/1.0.1/code-viewer.min.js"></script>
<!-- =======================================================
* Template Name: Flutter31
* Updated: Sep 18 2023 with Bootstrap v5.3.2
* Template URL: https://bootstrapmade.com/flexstart-bootstrap-startup-template/
* Author: BootstrapMade.com
* License: https://bootstrapmade.com/license/
======================================================== -->
</head>
<body>
<!-- ======= Header ======= -->
<header id="header" class="header fixed-top">
<div class="container-fluid container-xl d-flex align-items-center justify-content-between">
<a href="index.html" class="logo d-flex align-items-center">
<img src="assets/img/logo.png" alt="">
<span>Flutter31</span>
</a>
<nav id="navbar" class="navbar">
<ul>
<li><a class="nav-link scrollto active" href="index.html#hero">Start</a></li>
<li class="dropdown"><a href="index.html#appinfo"><span>Overview</span><i class="bi bi-chevron-down"></i></a>
<ul>
<li><a href="index.html#appinfo">Blackhole</a></li>
<li><a href="index.html#appinfo_functionalities">Functionalities</a></li>
<li><a href="index.html#appinfo_value">Value Proposition</a></li>
<li><a href="index.html#appinfo_bqs">Business Questions</a></li>
</ul>
</li>
<li class="dropdown"><a href="ar2.html"><span>Design</span><i class="bi bi-chevron-down"></i></a>
<ul>
<li><a href="ar2.html#architecture">Architecture</a></li>
<li><a href="ar2.html#views">App Views</a></li>
<li><a href="ar2.html#qas">Quality Attributes</a></li>
</ul>
</li>
<li class="dropdown"><a href="ar3.html"><span>Techniques</span><i class="bi bi-chevron-down"></i></a>
<ul>
<li><a href="ar3.html#ecns">Eventual Connectivity</a></li>
<li><a href="ar3.html#caching">Caching Strategies</a></li>
<li><a href="ar3.html#memory">Memory Managment</a></li>
<li><a href="ar3.html#threading">Threading</a></li>
</ul>
</li>
<li class="dropdown"><a href="ar4.html"><span>Performance</span><i class="bi bi-chevron-down"></i></a>
<ul>
<li><a href="ar4.html#scenarios">Performance Scenarios</a></li>
<li><a href="ar4.html#problems_strenghts">Problems and Strengths</a></li>
<li><a href="ar4.html#uoptimization">Micro Optimization</a></li>
</ul>
</li>
<li><a class="nav-link scrollto" href="sonar.html">Sonar</a></li>
<li><a class="getstarted scrollto" href="https://blackhole-apk.com/">Download</a></li>
</ul>
<i class="bi bi-list mobile-nav-toggle"></i>
</nav>
</div>
</header><!-- End Header -->
<main id="main">
<!-- ======= Breadcrumbs ======= -->
<section class="breadcrumbs">
<div class="container">
<ol>
<li><a href="index.html">Home</a></li>
<li><a href="ar2.html">Design</a></li>
<li>DTO</li>
</ol>
<h2>Data Transfer Object (DTO)</h2>
</div>
</section><!-- End Breadcrumbs -->
<!-- ======= Blog Single Section ======= -->
<section id="blog" class="blog">
<div class="container" data-aos="fade-up">
<div class="row">
<div class>
<article class="entry entry-single">
<h2 class="entry-title">
<a>Data Transfer Object in BlackHole</a>
</h2>
<div class="entry-content">
<p>
The data transfer object pattern can be seen in this project as for example the son_item is a DTO that has all the information regarding a song. This object is just for reading the elements inside this object and it also allows to be loaded from JSON and transformed to JSON, in this manner this object can be serialized easily. The images above present the fields of the DTO and also the methods to serialize and reserialize the object that are the toJson and fromJson respectively. The data transfer object serves as a better way to access information of the data source thanks to the representation of this information in an object that has serializable properties.
</p>
<h3>DTO in the Blackhole code</h3>
<p>
1. The structure of the project shows the main components that a model view
view model design patter has. However, the project is missing the folder that
should save de view model. This view model is presented along different other
components that we will present later.
</p>
<div class="code-space">
<code-viewer title="yt_music.dart">
class SongItem {
final String id;
final String album;
final String? albumId;
final List<String> artists;
final List<Map<String, String>>? artistIds;
final String? albumArtist;
final Duration duration;
final String genre;
final bool hasLyrics;
final String image;
final List allImages;
final String? language;
final String? releaseDate;
final String? subtitle;
final String title;
final String? url;
final List<String> allUrls;
final int? year;
final int? quality;
final String permaUrl;
final int expireAt;
final bool isYt;
final String lyrics;
final int? trackNumber;
final int? discNumber;
final bool isOffline;
final bool addedByAutoplay;
final bool kbps320;
final int likes;
</code-viewer>
</div>
<div class="code-space">
<code-viewer title="yt_music.dart">
factory SongItem.fromJson(String source) =>
SongItem.fromMap(json.decode(source) as Map<String, dynamic>);
</code-viewer>
</div>
</div>
</article><!-- End blog entry -->
</div><!-- End blog entries list -->
<div class="col-lg-4">
<div class="sidebar">
<h3 class="sidebar-title">Search</h3>
<div class="sidebar-item search-form">
<form action="">
<input type="text">
<button type="submit"><i class="bi bi-search"></i></button>
</form>
</div><!-- End sidebar search formn-->
<h3 class="sidebar-title">Other Patterns</h3>
<div class="sidebar-item categories">
<ul>
<li><a href="mvvm.html">MVVM <span>(Model-View-ViewModel)</span></a></li>
<li><a href="facade.html">Facade</a></li>
</ul>
</div><!-- End sidebar categories-->
</div><!-- End sidebar -->
</div><!-- End blog sidebar -->
</div>
</div>
</section><!-- End Blog Single Section -->
</main><!-- End #main -->
<!-- ======= Footer ======= -->
<footer id="footer" class="footer">
<div class="footer-top">
<div class="container">
<div class="row gy-1">
<div class="col-lg-10 col-md-12 footer-info">
<a href="index.html" class="logo d-flex align-items-center">
<img src="assets/img/logo.png" alt="">
<span>Flutter31</span>
</a>
<p>At Flutter31, we're a team of developers passionate about Flutter mobile applications. Our focus is on creating and analyzing apps like Blackhole, aiming to enhance your digital experience with innovative and user-friendly solutions.</p>
<div class="social-links mt-3">
<a href="https://github.com/ISIS3510-202320-Team31/Flutter" class="github"><i class="bi bi-github"></i></a>
</div>
</div>
</div>
</div>
</div>
<div class="container">
<div class="copyright">
© Copyright <strong><span>Flutter 31</span></strong>. All Rights Reserved
</div>
</div>
</footer>
<a href="#" class="back-to-top d-flex align-items-center justify-content-center"><i class="bi bi-arrow-up-short"></i></a>
<!-- Vendor JS Files -->
<script src="assets/vendor/purecounter/purecounter_vanilla.js"></script>
<script src="assets/vendor/aos/aos.js"></script>
<script src="assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="assets/vendor/glightbox/js/glightbox.min.js"></script>
<script src="assets/vendor/isotope-layout/isotope.pkgd.min.js"></script>
<script src="assets/vendor/swiper/swiper-bundle.min.js"></script>
<script src="assets/vendor/php-email-form/validate.js"></script>
<!-- Template Main JS File -->
<script src="assets/js/main.js"></script>
</body>
</html>