diff --git a/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.0/checksums/checksums.lock b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.0/checksums/checksums.lock new file mode 100644 index 0000000..3a89a71 Binary files /dev/null and b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.0/checksums/checksums.lock differ diff --git a/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.0/fileChanges/last-build.bin b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.0/fileChanges/last-build.bin new file mode 100644 index 0000000..f76dd23 Binary files /dev/null and b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.0/fileChanges/last-build.bin differ diff --git a/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.0/fileHashes/fileHashes.lock b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.0/fileHashes/fileHashes.lock new file mode 100644 index 0000000..1264189 Binary files /dev/null and b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.0/fileHashes/fileHashes.lock differ diff --git a/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.0/gc.properties b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.0/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.5/checksums/checksums.lock b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.5/checksums/checksums.lock new file mode 100644 index 0000000..87c23ef Binary files /dev/null and b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.5/checksums/checksums.lock differ diff --git a/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.5/checksums/md5-checksums.bin b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.5/checksums/md5-checksums.bin new file mode 100644 index 0000000..0931dea Binary files /dev/null and b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.5/checksums/md5-checksums.bin differ diff --git a/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.5/checksums/sha1-checksums.bin b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.5/checksums/sha1-checksums.bin new file mode 100644 index 0000000..b07879d Binary files /dev/null and b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.5/checksums/sha1-checksums.bin differ diff --git a/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.5/dependencies-accessors/dependencies-accessors.lock b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.5/dependencies-accessors/dependencies-accessors.lock new file mode 100644 index 0000000..9cf6f84 Binary files /dev/null and b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.5/dependencies-accessors/dependencies-accessors.lock differ diff --git a/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.5/dependencies-accessors/gc.properties b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.5/dependencies-accessors/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.5/executionHistory/executionHistory.bin b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.5/executionHistory/executionHistory.bin new file mode 100644 index 0000000..3fe5f4f Binary files /dev/null and b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.5/executionHistory/executionHistory.bin differ diff --git a/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.5/executionHistory/executionHistory.lock b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.5/executionHistory/executionHistory.lock new file mode 100644 index 0000000..91f599b Binary files /dev/null and b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.5/executionHistory/executionHistory.lock differ diff --git a/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.5/fileChanges/last-build.bin b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.5/fileChanges/last-build.bin new file mode 100644 index 0000000..f76dd23 Binary files /dev/null and b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.5/fileChanges/last-build.bin differ diff --git a/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.5/fileHashes/fileHashes.bin b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.5/fileHashes/fileHashes.bin new file mode 100644 index 0000000..17e0580 Binary files /dev/null and b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.5/fileHashes/fileHashes.bin differ diff --git a/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.5/fileHashes/fileHashes.lock b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.5/fileHashes/fileHashes.lock new file mode 100644 index 0000000..e6718d7 Binary files /dev/null and b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.5/fileHashes/fileHashes.lock differ diff --git a/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.5/fileHashes/resourceHashesCache.bin b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.5/fileHashes/resourceHashesCache.bin new file mode 100644 index 0000000..0b1f8d1 Binary files /dev/null and b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.5/fileHashes/resourceHashesCache.bin differ diff --git a/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.5/gc.properties b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/8.5/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/11_code/creationalPatterns/AbstractFactoryExample/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/buildOutputCleanup/buildOutputCleanup.lock new file mode 100644 index 0000000..35b4949 Binary files /dev/null and b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/11_code/creationalPatterns/AbstractFactoryExample/.gradle/buildOutputCleanup/cache.properties b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/buildOutputCleanup/cache.properties new file mode 100644 index 0000000..7142ccb --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/buildOutputCleanup/cache.properties @@ -0,0 +1,2 @@ +#Thu Nov 13 10:47:10 KST 2025 +gradle.version=8.5 diff --git a/11_code/creationalPatterns/AbstractFactoryExample/.gradle/buildOutputCleanup/outputFiles.bin b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/buildOutputCleanup/outputFiles.bin new file mode 100644 index 0000000..2b9136f Binary files /dev/null and b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/buildOutputCleanup/outputFiles.bin differ diff --git a/11_code/creationalPatterns/AbstractFactoryExample/.gradle/config.properties b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/config.properties new file mode 100644 index 0000000..d91efa1 --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/config.properties @@ -0,0 +1,2 @@ +#Thu Nov 13 10:45:45 KST 2025 +java.home=C\:\\Program Files\\Android\\Android Studio\\jbr diff --git a/11_code/creationalPatterns/AbstractFactoryExample/.gradle/file-system.probe b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/file-system.probe new file mode 100644 index 0000000..b2d6c0d Binary files /dev/null and b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/file-system.probe differ diff --git a/11_code/creationalPatterns/AbstractFactoryExample/.gradle/vcs-1/gc.properties b/11_code/creationalPatterns/AbstractFactoryExample/.gradle/vcs-1/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/11_code/creationalPatterns/AbstractFactoryExample/.idea/.gitignore b/11_code/creationalPatterns/AbstractFactoryExample/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/11_code/creationalPatterns/AbstractFactoryExample/.idea/AndroidProjectSystem.xml b/11_code/creationalPatterns/AbstractFactoryExample/.idea/AndroidProjectSystem.xml new file mode 100644 index 0000000..4a53bee --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/.idea/AndroidProjectSystem.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/AbstractFactoryExample/.idea/caches/deviceStreaming.xml b/11_code/creationalPatterns/AbstractFactoryExample/.idea/caches/deviceStreaming.xml new file mode 100644 index 0000000..e5f298b --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/.idea/caches/deviceStreaming.xml @@ -0,0 +1,993 @@ + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/AbstractFactoryExample/.idea/compiler.xml b/11_code/creationalPatterns/AbstractFactoryExample/.idea/compiler.xml new file mode 100644 index 0000000..b86273d --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/AbstractFactoryExample/.idea/deploymentTargetSelector.xml b/11_code/creationalPatterns/AbstractFactoryExample/.idea/deploymentTargetSelector.xml new file mode 100644 index 0000000..b268ef3 --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/.idea/deploymentTargetSelector.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/AbstractFactoryExample/.idea/gradle.xml b/11_code/creationalPatterns/AbstractFactoryExample/.idea/gradle.xml new file mode 100644 index 0000000..e913f3b --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/.idea/gradle.xml @@ -0,0 +1,20 @@ + + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/AbstractFactoryExample/.idea/kotlinc.xml b/11_code/creationalPatterns/AbstractFactoryExample/.idea/kotlinc.xml new file mode 100644 index 0000000..e805548 --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/.idea/kotlinc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/AbstractFactoryExample/.idea/migrations.xml b/11_code/creationalPatterns/AbstractFactoryExample/.idea/migrations.xml new file mode 100644 index 0000000..f8051a6 --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/.idea/migrations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/AbstractFactoryExample/.idea/misc.xml b/11_code/creationalPatterns/AbstractFactoryExample/.idea/misc.xml new file mode 100644 index 0000000..74dd639 --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/.idea/misc.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/AbstractFactoryExample/.idea/runConfigurations.xml b/11_code/creationalPatterns/AbstractFactoryExample/.idea/runConfigurations.xml new file mode 100644 index 0000000..16660f1 --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/.idea/runConfigurations.xml @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/AbstractFactoryExample/.idea/vcs.xml b/11_code/creationalPatterns/AbstractFactoryExample/.idea/vcs.xml new file mode 100644 index 0000000..c2365ab --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/AbstractFactoryExample/.run/Run AbstractFactoryExample.run.xml b/11_code/creationalPatterns/AbstractFactoryExample/.run/Run AbstractFactoryExample.run.xml new file mode 100644 index 0000000..464474d --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/.run/Run AbstractFactoryExample.run.xml @@ -0,0 +1,24 @@ + + + + + + + true + true + false + false + + + diff --git a/11_code/creationalPatterns/AbstractFactoryExample/abstractfactoryexample/.gitignore b/11_code/creationalPatterns/AbstractFactoryExample/abstractfactoryexample/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/abstractfactoryexample/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/11_code/creationalPatterns/AbstractFactoryExample/abstractfactoryexample/build.gradle.kts b/11_code/creationalPatterns/AbstractFactoryExample/abstractfactoryexample/build.gradle.kts new file mode 100644 index 0000000..e3501e0 --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/abstractfactoryexample/build.gradle.kts @@ -0,0 +1,21 @@ +plugins { + id("java-library") + id("org.jetbrains.kotlin.jvm") + application +} + +group = "com.example" +version = "1.0-SNAPSHOT" + +dependencies { + implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.20") + testImplementation("junit:junit:4.13.2") +} + +kotlin { + jvmToolchain(21) +} + +application { + mainClass.set("com.example.abstractfactoryexample.ClientKt") +} diff --git a/11_code/creationalPatterns/AbstractFactoryExample/abstractfactoryexample/src/main/kotlin/com/example/abstractfactoryexample/Client.kt b/11_code/creationalPatterns/AbstractFactoryExample/abstractfactoryexample/src/main/kotlin/com/example/abstractfactoryexample/Client.kt new file mode 100644 index 0000000..5dbb434 --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/abstractfactoryexample/src/main/kotlin/com/example/abstractfactoryexample/Client.kt @@ -0,0 +1,22 @@ +package com.example.abstractfactoryexample + +fun main(args: Array) { + val company = "Apple" + val phone: Phone + val tablet: Tablet + val laptop: Laptop + + if (company == "Apple") { + phone = iPhone15() + tablet = iPad() + laptop = MacBook() + } else { + phone = GalaxyS23() + tablet = GalaxyTab() + laptop = GalaxyBook() + } + + phone.call() + tablet.touch() + laptop.typing() +} diff --git a/11_code/creationalPatterns/AbstractFactoryExample/abstractfactoryexample/src/main/kotlin/com/example/abstractfactoryexample/GalaxyBook.kt b/11_code/creationalPatterns/AbstractFactoryExample/abstractfactoryexample/src/main/kotlin/com/example/abstractfactoryexample/GalaxyBook.kt new file mode 100644 index 0000000..0b28bf2 --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/abstractfactoryexample/src/main/kotlin/com/example/abstractfactoryexample/GalaxyBook.kt @@ -0,0 +1,7 @@ +package com.example.abstractfactoryexample + +class GalaxyBook : Laptop { + override fun typing() { + println("Typing Galaxy Book.") + } +} diff --git a/11_code/creationalPatterns/AbstractFactoryExample/abstractfactoryexample/src/main/kotlin/com/example/abstractfactoryexample/GalaxyS23.kt b/11_code/creationalPatterns/AbstractFactoryExample/abstractfactoryexample/src/main/kotlin/com/example/abstractfactoryexample/GalaxyS23.kt new file mode 100644 index 0000000..09d9758 --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/abstractfactoryexample/src/main/kotlin/com/example/abstractfactoryexample/GalaxyS23.kt @@ -0,0 +1,7 @@ +package com.example.abstractfactoryexample + +class GalaxyS23 : Phone { + override fun call() { + println("Ring from Galaxy S23.") + } +} diff --git a/11_code/creationalPatterns/AbstractFactoryExample/abstractfactoryexample/src/main/kotlin/com/example/abstractfactoryexample/GalaxyTab.kt b/11_code/creationalPatterns/AbstractFactoryExample/abstractfactoryexample/src/main/kotlin/com/example/abstractfactoryexample/GalaxyTab.kt new file mode 100644 index 0000000..71a08e7 --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/abstractfactoryexample/src/main/kotlin/com/example/abstractfactoryexample/GalaxyTab.kt @@ -0,0 +1,7 @@ +package com.example.abstractfactoryexample + +class GalaxyTab : Tablet { + override fun touch() { + println("Touch Galaxy Tab.") + } +} diff --git a/11_code/creationalPatterns/AbstractFactoryExample/abstractfactoryexample/src/main/kotlin/com/example/abstractfactoryexample/Laptop.kt b/11_code/creationalPatterns/AbstractFactoryExample/abstractfactoryexample/src/main/kotlin/com/example/abstractfactoryexample/Laptop.kt new file mode 100644 index 0000000..b8448f5 --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/abstractfactoryexample/src/main/kotlin/com/example/abstractfactoryexample/Laptop.kt @@ -0,0 +1,5 @@ +package com.example.abstractfactoryexample + +interface Laptop { + fun typing() +} diff --git a/11_code/creationalPatterns/AbstractFactoryExample/abstractfactoryexample/src/main/kotlin/com/example/abstractfactoryexample/MacBook.kt b/11_code/creationalPatterns/AbstractFactoryExample/abstractfactoryexample/src/main/kotlin/com/example/abstractfactoryexample/MacBook.kt new file mode 100644 index 0000000..3d08cd4 --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/abstractfactoryexample/src/main/kotlin/com/example/abstractfactoryexample/MacBook.kt @@ -0,0 +1,7 @@ +package com.example.abstractfactoryexample + +class MacBook : Laptop { + override fun typing() { + println("Typing MacBook.") + } +} diff --git a/11_code/creationalPatterns/AbstractFactoryExample/abstractfactoryexample/src/main/kotlin/com/example/abstractfactoryexample/Phone.kt b/11_code/creationalPatterns/AbstractFactoryExample/abstractfactoryexample/src/main/kotlin/com/example/abstractfactoryexample/Phone.kt new file mode 100644 index 0000000..62e327b --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/abstractfactoryexample/src/main/kotlin/com/example/abstractfactoryexample/Phone.kt @@ -0,0 +1,5 @@ +package com.example.abstractfactoryexample + +interface Phone { + fun call() +} diff --git a/11_code/creationalPatterns/AbstractFactoryExample/abstractfactoryexample/src/main/kotlin/com/example/abstractfactoryexample/Tablet.kt b/11_code/creationalPatterns/AbstractFactoryExample/abstractfactoryexample/src/main/kotlin/com/example/abstractfactoryexample/Tablet.kt new file mode 100644 index 0000000..29facb6 --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/abstractfactoryexample/src/main/kotlin/com/example/abstractfactoryexample/Tablet.kt @@ -0,0 +1,5 @@ +package com.example.abstractfactoryexample + +interface Tablet { + fun touch() +} diff --git a/11_code/creationalPatterns/AbstractFactoryExample/abstractfactoryexample/src/main/kotlin/com/example/abstractfactoryexample/iPad.kt b/11_code/creationalPatterns/AbstractFactoryExample/abstractfactoryexample/src/main/kotlin/com/example/abstractfactoryexample/iPad.kt new file mode 100644 index 0000000..413fbd4 --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/abstractfactoryexample/src/main/kotlin/com/example/abstractfactoryexample/iPad.kt @@ -0,0 +1,7 @@ +package com.example.abstractfactoryexample + +class iPad : Tablet { + override fun touch() { + println("Touch iPad.") + } +} diff --git a/11_code/creationalPatterns/AbstractFactoryExample/abstractfactoryexample/src/main/kotlin/com/example/abstractfactoryexample/iPhone15.kt b/11_code/creationalPatterns/AbstractFactoryExample/abstractfactoryexample/src/main/kotlin/com/example/abstractfactoryexample/iPhone15.kt new file mode 100644 index 0000000..b04a8db --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/abstractfactoryexample/src/main/kotlin/com/example/abstractfactoryexample/iPhone15.kt @@ -0,0 +1,7 @@ +package com.example.abstractfactoryexample + +class iPhone15 : Phone { + override fun call() { + println("Ring from iPhone 15.") + } +} diff --git a/11_code/creationalPatterns/AbstractFactoryExample/app/.gitignore b/11_code/creationalPatterns/AbstractFactoryExample/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/11_code/creationalPatterns/AbstractFactoryExample/app/build.gradle.kts b/11_code/creationalPatterns/AbstractFactoryExample/app/build.gradle.kts new file mode 100644 index 0000000..f2f9613 --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/app/build.gradle.kts @@ -0,0 +1,45 @@ +plugins { + id("com.android.application") + id("org.jetbrains.kotlin.android") +} + +android { + namespace = "com.example.abstractfactoryexample" + compileSdk = 33 + + defaultConfig { + applicationId = "com.example.abstractfactoryexample" + minSdk = 28 + targetSdk = 33 + versionCode = 1 + versionName = "1.0" + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = "1.8" + } +} + +dependencies { + implementation("androidx.appcompat:appcompat:1.6.1") + implementation("com.google.android.material:material:1.8.0") + implementation("org.jetbrains.kotlin:kotlin-stdlib:1.8.20") + testImplementation("junit:junit:4.13.2") + androidTestImplementation("androidx.test.ext:junit:1.1.5") + androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") +} diff --git a/11_code/creationalPatterns/AbstractFactoryExample/app/proguard-rules.pro b/11_code/creationalPatterns/AbstractFactoryExample/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/11_code/creationalPatterns/AbstractFactoryExample/app/src/androidTest/java/com/example/abstractfactoryexample/ExampleInstrumentedTest.java b/11_code/creationalPatterns/AbstractFactoryExample/app/src/androidTest/java/com/example/abstractfactoryexample/ExampleInstrumentedTest.java new file mode 100644 index 0000000..44d496e --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/app/src/androidTest/java/com/example/abstractfactoryexample/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.example.abstractfactoryexample; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("com.example.abstractfactoryexample", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/AndroidManifest.xml b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..43996ac --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/AndroidManifest.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/drawable/ic_launcher_background.xml b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/drawable/ic_launcher_foreground.xml b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/mipmap-anydpi/ic_launcher.xml b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/mipmap-anydpi/ic_launcher.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/mipmap-anydpi/ic_launcher.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/mipmap-anydpi/ic_launcher_round.xml b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/mipmap-anydpi/ic_launcher_round.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/mipmap-anydpi/ic_launcher_round.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000..c209e78 Binary files /dev/null and b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000..b2dfe3d Binary files /dev/null and b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000..4f0f1d6 Binary files /dev/null and b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000..62b611d Binary files /dev/null and b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000..948a307 Binary files /dev/null and b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..1b9a695 Binary files /dev/null and b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000..28d4b77 Binary files /dev/null and b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9287f50 Binary files /dev/null and b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000..aa7d642 Binary files /dev/null and b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9126ae3 Binary files /dev/null and b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/values-night/themes.xml b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..365cc40 --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/values-night/themes.xml @@ -0,0 +1,16 @@ + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/values/colors.xml b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..f8c6127 --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/values/colors.xml @@ -0,0 +1,10 @@ + + + #FFBB86FC + #FF6200EE + #FF3700B3 + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + \ No newline at end of file diff --git a/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/values/strings.xml b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..c68d12f --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + AbstractFactoryExample + \ No newline at end of file diff --git a/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/values/themes.xml b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..9d2a556 --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/values/themes.xml @@ -0,0 +1,16 @@ + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/xml/backup_rules.xml b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/xml/backup_rules.xml new file mode 100644 index 0000000..fa0f996 --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/xml/backup_rules.xml @@ -0,0 +1,13 @@ + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/xml/data_extraction_rules.xml b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/xml/data_extraction_rules.xml new file mode 100644 index 0000000..9ee9997 --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/app/src/main/res/xml/data_extraction_rules.xml @@ -0,0 +1,19 @@ + + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/AbstractFactoryExample/app/src/test/java/com/example/abstractfactoryexample/ExampleUnitTest.java b/11_code/creationalPatterns/AbstractFactoryExample/app/src/test/java/com/example/abstractfactoryexample/ExampleUnitTest.java new file mode 100644 index 0000000..a4e2c15 --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/app/src/test/java/com/example/abstractfactoryexample/ExampleUnitTest.java @@ -0,0 +1,17 @@ +package com.example.abstractfactoryexample; + +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } +} \ No newline at end of file diff --git a/11_code/creationalPatterns/AbstractFactoryExample/build.gradle.kts b/11_code/creationalPatterns/AbstractFactoryExample/build.gradle.kts new file mode 100644 index 0000000..1515483 --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/build.gradle.kts @@ -0,0 +1,6 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +plugins { + id("com.android.application") version "8.1.3" apply false + id("org.jetbrains.kotlin.android") version "1.9.20" apply false + id("org.jetbrains.kotlin.jvm") version "1.9.20" apply false +} diff --git a/11_code/creationalPatterns/AbstractFactoryExample/gradle.properties b/11_code/creationalPatterns/AbstractFactoryExample/gradle.properties new file mode 100644 index 0000000..3e927b1 --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/gradle.properties @@ -0,0 +1,21 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Enables namespacing of each library's R class so that its R class includes only the +# resources declared in the library itself and none from the library's dependencies, +# thereby reducing the size of the R class for that library +android.nonTransitiveRClass=true \ No newline at end of file diff --git a/11_code/creationalPatterns/AbstractFactoryExample/gradle/wrapper/gradle-wrapper.jar b/11_code/creationalPatterns/AbstractFactoryExample/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..e708b1c Binary files /dev/null and b/11_code/creationalPatterns/AbstractFactoryExample/gradle/wrapper/gradle-wrapper.jar differ diff --git a/11_code/creationalPatterns/AbstractFactoryExample/gradle/wrapper/gradle-wrapper.properties b/11_code/creationalPatterns/AbstractFactoryExample/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..26fa109 --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Tue Nov 14 21:20:17 KST 2023 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/11_code/creationalPatterns/AbstractFactoryExample/gradlew b/11_code/creationalPatterns/AbstractFactoryExample/gradlew new file mode 100755 index 0000000..4f906e0 --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/11_code/creationalPatterns/AbstractFactoryExample/gradlew.bat b/11_code/creationalPatterns/AbstractFactoryExample/gradlew.bat new file mode 100644 index 0000000..ac1b06f --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/11_code/creationalPatterns/AbstractFactoryExample/local.properties b/11_code/creationalPatterns/AbstractFactoryExample/local.properties new file mode 100644 index 0000000..f3da75c --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/local.properties @@ -0,0 +1,8 @@ +## This file must *NOT* be checked into Version Control Systems, +# as it contains information specific to your local configuration. +# +# Location of the SDK. This is only used by Gradle. +# For customization when using a Version Control System, please read the +# header note. +#Thu Nov 13 10:45:45 KST 2025 +sdk.dir=C\:\\Users\\th\\AppData\\Local\\Android\\Sdk diff --git a/11_code/creationalPatterns/AbstractFactoryExample/settings.gradle.kts b/11_code/creationalPatterns/AbstractFactoryExample/settings.gradle.kts new file mode 100644 index 0000000..da3ffc6 --- /dev/null +++ b/11_code/creationalPatterns/AbstractFactoryExample/settings.gradle.kts @@ -0,0 +1,18 @@ +pluginManagement { + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} + +rootProject.name = "AbstractFactoryExample" +include(":app") +include(":abstractfactoryexample") diff --git a/11_code/creationalPatterns/BuilderExample/.gradle/8.5/checksums/checksums.lock b/11_code/creationalPatterns/BuilderExample/.gradle/8.5/checksums/checksums.lock new file mode 100644 index 0000000..06a9249 Binary files /dev/null and b/11_code/creationalPatterns/BuilderExample/.gradle/8.5/checksums/checksums.lock differ diff --git a/11_code/creationalPatterns/BuilderExample/.gradle/8.5/dependencies-accessors/dependencies-accessors.lock b/11_code/creationalPatterns/BuilderExample/.gradle/8.5/dependencies-accessors/dependencies-accessors.lock new file mode 100644 index 0000000..85396de Binary files /dev/null and b/11_code/creationalPatterns/BuilderExample/.gradle/8.5/dependencies-accessors/dependencies-accessors.lock differ diff --git a/11_code/creationalPatterns/BuilderExample/.gradle/8.5/dependencies-accessors/gc.properties b/11_code/creationalPatterns/BuilderExample/.gradle/8.5/dependencies-accessors/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/11_code/creationalPatterns/BuilderExample/.gradle/8.5/executionHistory/executionHistory.bin b/11_code/creationalPatterns/BuilderExample/.gradle/8.5/executionHistory/executionHistory.bin new file mode 100644 index 0000000..c3b0e39 Binary files /dev/null and b/11_code/creationalPatterns/BuilderExample/.gradle/8.5/executionHistory/executionHistory.bin differ diff --git a/11_code/creationalPatterns/BuilderExample/.gradle/8.5/executionHistory/executionHistory.lock b/11_code/creationalPatterns/BuilderExample/.gradle/8.5/executionHistory/executionHistory.lock new file mode 100644 index 0000000..6f09ce4 Binary files /dev/null and b/11_code/creationalPatterns/BuilderExample/.gradle/8.5/executionHistory/executionHistory.lock differ diff --git a/11_code/creationalPatterns/BuilderExample/.gradle/8.5/fileChanges/last-build.bin b/11_code/creationalPatterns/BuilderExample/.gradle/8.5/fileChanges/last-build.bin new file mode 100644 index 0000000..f76dd23 Binary files /dev/null and b/11_code/creationalPatterns/BuilderExample/.gradle/8.5/fileChanges/last-build.bin differ diff --git a/11_code/creationalPatterns/BuilderExample/.gradle/8.5/fileHashes/fileHashes.bin b/11_code/creationalPatterns/BuilderExample/.gradle/8.5/fileHashes/fileHashes.bin new file mode 100644 index 0000000..969be40 Binary files /dev/null and b/11_code/creationalPatterns/BuilderExample/.gradle/8.5/fileHashes/fileHashes.bin differ diff --git a/11_code/creationalPatterns/BuilderExample/.gradle/8.5/fileHashes/fileHashes.lock b/11_code/creationalPatterns/BuilderExample/.gradle/8.5/fileHashes/fileHashes.lock new file mode 100644 index 0000000..caba066 Binary files /dev/null and b/11_code/creationalPatterns/BuilderExample/.gradle/8.5/fileHashes/fileHashes.lock differ diff --git a/11_code/creationalPatterns/BuilderExample/.gradle/8.5/fileHashes/resourceHashesCache.bin b/11_code/creationalPatterns/BuilderExample/.gradle/8.5/fileHashes/resourceHashesCache.bin new file mode 100644 index 0000000..babbe15 Binary files /dev/null and b/11_code/creationalPatterns/BuilderExample/.gradle/8.5/fileHashes/resourceHashesCache.bin differ diff --git a/11_code/creationalPatterns/BuilderExample/.gradle/8.5/gc.properties b/11_code/creationalPatterns/BuilderExample/.gradle/8.5/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/11_code/creationalPatterns/BuilderExample/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/11_code/creationalPatterns/BuilderExample/.gradle/buildOutputCleanup/buildOutputCleanup.lock new file mode 100644 index 0000000..8be6522 Binary files /dev/null and b/11_code/creationalPatterns/BuilderExample/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/11_code/creationalPatterns/BuilderExample/.gradle/buildOutputCleanup/cache.properties b/11_code/creationalPatterns/BuilderExample/.gradle/buildOutputCleanup/cache.properties new file mode 100644 index 0000000..3b3f4de --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/.gradle/buildOutputCleanup/cache.properties @@ -0,0 +1,2 @@ +#Thu Nov 13 11:00:20 KST 2025 +gradle.version=8.5 diff --git a/11_code/creationalPatterns/BuilderExample/.gradle/buildOutputCleanup/outputFiles.bin b/11_code/creationalPatterns/BuilderExample/.gradle/buildOutputCleanup/outputFiles.bin new file mode 100644 index 0000000..d2f968e Binary files /dev/null and b/11_code/creationalPatterns/BuilderExample/.gradle/buildOutputCleanup/outputFiles.bin differ diff --git a/11_code/creationalPatterns/BuilderExample/.gradle/config.properties b/11_code/creationalPatterns/BuilderExample/.gradle/config.properties new file mode 100644 index 0000000..185fbd9 --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/.gradle/config.properties @@ -0,0 +1,2 @@ +#Thu Nov 13 11:00:11 KST 2025 +java.home=C\:\\Program Files\\Android\\Android Studio\\jbr diff --git a/11_code/creationalPatterns/BuilderExample/.gradle/file-system.probe b/11_code/creationalPatterns/BuilderExample/.gradle/file-system.probe new file mode 100644 index 0000000..e331fd1 Binary files /dev/null and b/11_code/creationalPatterns/BuilderExample/.gradle/file-system.probe differ diff --git a/11_code/creationalPatterns/BuilderExample/.gradle/vcs-1/gc.properties b/11_code/creationalPatterns/BuilderExample/.gradle/vcs-1/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/11_code/creationalPatterns/BuilderExample/.idea/.gitignore b/11_code/creationalPatterns/BuilderExample/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/11_code/creationalPatterns/BuilderExample/.idea/AndroidProjectSystem.xml b/11_code/creationalPatterns/BuilderExample/.idea/AndroidProjectSystem.xml new file mode 100644 index 0000000..4a53bee --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/.idea/AndroidProjectSystem.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/BuilderExample/.idea/caches/deviceStreaming.xml b/11_code/creationalPatterns/BuilderExample/.idea/caches/deviceStreaming.xml new file mode 100644 index 0000000..e5f298b --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/.idea/caches/deviceStreaming.xml @@ -0,0 +1,993 @@ + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/BuilderExample/.idea/compiler.xml b/11_code/creationalPatterns/BuilderExample/.idea/compiler.xml new file mode 100644 index 0000000..b86273d --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/BuilderExample/.idea/deploymentTargetSelector.xml b/11_code/creationalPatterns/BuilderExample/.idea/deploymentTargetSelector.xml new file mode 100644 index 0000000..b268ef3 --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/.idea/deploymentTargetSelector.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/BuilderExample/.idea/gradle.xml b/11_code/creationalPatterns/BuilderExample/.idea/gradle.xml new file mode 100644 index 0000000..262f4f4 --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/.idea/gradle.xml @@ -0,0 +1,20 @@ + + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/BuilderExample/.idea/kotlinc.xml b/11_code/creationalPatterns/BuilderExample/.idea/kotlinc.xml new file mode 100644 index 0000000..e805548 --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/.idea/kotlinc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/BuilderExample/.idea/migrations.xml b/11_code/creationalPatterns/BuilderExample/.idea/migrations.xml new file mode 100644 index 0000000..f8051a6 --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/.idea/migrations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/BuilderExample/.idea/misc.xml b/11_code/creationalPatterns/BuilderExample/.idea/misc.xml new file mode 100644 index 0000000..74dd639 --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/.idea/misc.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/BuilderExample/.idea/runConfigurations.xml b/11_code/creationalPatterns/BuilderExample/.idea/runConfigurations.xml new file mode 100644 index 0000000..16660f1 --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/.idea/runConfigurations.xml @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/BuilderExample/.idea/vcs.xml b/11_code/creationalPatterns/BuilderExample/.idea/vcs.xml new file mode 100644 index 0000000..c2365ab --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/BuilderExample/.run/Run BuilderExample.run.xml b/11_code/creationalPatterns/BuilderExample/.run/Run BuilderExample.run.xml new file mode 100644 index 0000000..eccc461 --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/.run/Run BuilderExample.run.xml @@ -0,0 +1,24 @@ + + + + + + + true + true + false + false + + + diff --git a/11_code/creationalPatterns/BuilderExample/app/.gitignore b/11_code/creationalPatterns/BuilderExample/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/11_code/creationalPatterns/BuilderExample/app/build.gradle.kts b/11_code/creationalPatterns/BuilderExample/app/build.gradle.kts new file mode 100644 index 0000000..9987160 --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/app/build.gradle.kts @@ -0,0 +1,45 @@ +plugins { + id("com.android.application") + id("org.jetbrains.kotlin.android") +} + +android { + namespace = "com.example.builderexample" + compileSdk = 33 + + defaultConfig { + applicationId = "com.example.builderexample" + minSdk = 28 + targetSdk = 33 + versionCode = 1 + versionName = "1.0" + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = "1.8" + } +} + +dependencies { + implementation("androidx.appcompat:appcompat:1.6.1") + implementation("com.google.android.material:material:1.8.0") + implementation("org.jetbrains.kotlin:kotlin-stdlib:1.8.20") + testImplementation("junit:junit:4.13.2") + androidTestImplementation("androidx.test.ext:junit:1.1.5") + androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") +} diff --git a/11_code/creationalPatterns/BuilderExample/app/proguard-rules.pro b/11_code/creationalPatterns/BuilderExample/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/11_code/creationalPatterns/BuilderExample/app/src/androidTest/java/com/example/builderexample/ExampleInstrumentedTest.java b/11_code/creationalPatterns/BuilderExample/app/src/androidTest/java/com/example/builderexample/ExampleInstrumentedTest.java new file mode 100644 index 0000000..bde234a --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/app/src/androidTest/java/com/example/builderexample/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.example.builderexample; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("com.example.builderexample", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/11_code/creationalPatterns/BuilderExample/app/src/main/AndroidManifest.xml b/11_code/creationalPatterns/BuilderExample/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..b097058 --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/app/src/main/AndroidManifest.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/BuilderExample/app/src/main/res/drawable/ic_launcher_background.xml b/11_code/creationalPatterns/BuilderExample/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/11_code/creationalPatterns/BuilderExample/app/src/main/res/drawable/ic_launcher_foreground.xml b/11_code/creationalPatterns/BuilderExample/app/src/main/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/BuilderExample/app/src/main/res/mipmap-anydpi/ic_launcher.xml b/11_code/creationalPatterns/BuilderExample/app/src/main/res/mipmap-anydpi/ic_launcher.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/app/src/main/res/mipmap-anydpi/ic_launcher.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/BuilderExample/app/src/main/res/mipmap-anydpi/ic_launcher_round.xml b/11_code/creationalPatterns/BuilderExample/app/src/main/res/mipmap-anydpi/ic_launcher_round.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/app/src/main/res/mipmap-anydpi/ic_launcher_round.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/BuilderExample/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/11_code/creationalPatterns/BuilderExample/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000..c209e78 Binary files /dev/null and b/11_code/creationalPatterns/BuilderExample/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/11_code/creationalPatterns/BuilderExample/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/11_code/creationalPatterns/BuilderExample/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000..b2dfe3d Binary files /dev/null and b/11_code/creationalPatterns/BuilderExample/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/11_code/creationalPatterns/BuilderExample/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/11_code/creationalPatterns/BuilderExample/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000..4f0f1d6 Binary files /dev/null and b/11_code/creationalPatterns/BuilderExample/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/11_code/creationalPatterns/BuilderExample/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/11_code/creationalPatterns/BuilderExample/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000..62b611d Binary files /dev/null and b/11_code/creationalPatterns/BuilderExample/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/11_code/creationalPatterns/BuilderExample/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/11_code/creationalPatterns/BuilderExample/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000..948a307 Binary files /dev/null and b/11_code/creationalPatterns/BuilderExample/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/11_code/creationalPatterns/BuilderExample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/11_code/creationalPatterns/BuilderExample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..1b9a695 Binary files /dev/null and b/11_code/creationalPatterns/BuilderExample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/11_code/creationalPatterns/BuilderExample/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/11_code/creationalPatterns/BuilderExample/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000..28d4b77 Binary files /dev/null and b/11_code/creationalPatterns/BuilderExample/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/11_code/creationalPatterns/BuilderExample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/11_code/creationalPatterns/BuilderExample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9287f50 Binary files /dev/null and b/11_code/creationalPatterns/BuilderExample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/11_code/creationalPatterns/BuilderExample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/11_code/creationalPatterns/BuilderExample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000..aa7d642 Binary files /dev/null and b/11_code/creationalPatterns/BuilderExample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/11_code/creationalPatterns/BuilderExample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/11_code/creationalPatterns/BuilderExample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9126ae3 Binary files /dev/null and b/11_code/creationalPatterns/BuilderExample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/11_code/creationalPatterns/BuilderExample/app/src/main/res/values-night/themes.xml b/11_code/creationalPatterns/BuilderExample/app/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..de2c313 --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/app/src/main/res/values-night/themes.xml @@ -0,0 +1,16 @@ + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/BuilderExample/app/src/main/res/values/colors.xml b/11_code/creationalPatterns/BuilderExample/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..f8c6127 --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/app/src/main/res/values/colors.xml @@ -0,0 +1,10 @@ + + + #FFBB86FC + #FF6200EE + #FF3700B3 + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + \ No newline at end of file diff --git a/11_code/creationalPatterns/BuilderExample/app/src/main/res/values/strings.xml b/11_code/creationalPatterns/BuilderExample/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..c1b9bf8 --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/app/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + BuilderExample + \ No newline at end of file diff --git a/11_code/creationalPatterns/BuilderExample/app/src/main/res/values/themes.xml b/11_code/creationalPatterns/BuilderExample/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..8438560 --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/app/src/main/res/values/themes.xml @@ -0,0 +1,16 @@ + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/BuilderExample/app/src/main/res/xml/backup_rules.xml b/11_code/creationalPatterns/BuilderExample/app/src/main/res/xml/backup_rules.xml new file mode 100644 index 0000000..fa0f996 --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/app/src/main/res/xml/backup_rules.xml @@ -0,0 +1,13 @@ + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/BuilderExample/app/src/main/res/xml/data_extraction_rules.xml b/11_code/creationalPatterns/BuilderExample/app/src/main/res/xml/data_extraction_rules.xml new file mode 100644 index 0000000..9ee9997 --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/app/src/main/res/xml/data_extraction_rules.xml @@ -0,0 +1,19 @@ + + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/BuilderExample/app/src/test/java/com/example/builderexample/ExampleUnitTest.java b/11_code/creationalPatterns/BuilderExample/app/src/test/java/com/example/builderexample/ExampleUnitTest.java new file mode 100644 index 0000000..2909c39 --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/app/src/test/java/com/example/builderexample/ExampleUnitTest.java @@ -0,0 +1,17 @@ +package com.example.builderexample; + +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } +} \ No newline at end of file diff --git a/11_code/creationalPatterns/BuilderExample/build.gradle.kts b/11_code/creationalPatterns/BuilderExample/build.gradle.kts new file mode 100644 index 0000000..1515483 --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/build.gradle.kts @@ -0,0 +1,6 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +plugins { + id("com.android.application") version "8.1.3" apply false + id("org.jetbrains.kotlin.android") version "1.9.20" apply false + id("org.jetbrains.kotlin.jvm") version "1.9.20" apply false +} diff --git a/11_code/creationalPatterns/BuilderExample/builderexample/.gitignore b/11_code/creationalPatterns/BuilderExample/builderexample/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/builderexample/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/11_code/creationalPatterns/BuilderExample/builderexample/build.gradle.kts b/11_code/creationalPatterns/BuilderExample/builderexample/build.gradle.kts new file mode 100644 index 0000000..8047717 --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/builderexample/build.gradle.kts @@ -0,0 +1,21 @@ +plugins { + id("java-library") + id("org.jetbrains.kotlin.jvm") + application +} + +group = "com.example" +version = "1.0-SNAPSHOT" + +dependencies { + implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.20") + testImplementation("junit:junit:4.13.2") +} + +kotlin { + jvmToolchain(21) +} + +application { + mainClass.set("com.example.builderexample.ClientKt") +} diff --git a/11_code/creationalPatterns/BuilderExample/builderexample/src/main/kotlin/com/example/builderexample/Client.kt b/11_code/creationalPatterns/BuilderExample/builderexample/src/main/kotlin/com/example/builderexample/Client.kt new file mode 100644 index 0000000..cbca101 --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/builderexample/src/main/kotlin/com/example/builderexample/Client.kt @@ -0,0 +1,11 @@ +package com.example.builderexample + +fun main(args: Array) { + val trainer = ModelTrainer( + "Yolov5", + "TrainDataloader", "TestDataloader", + "SGD", "MSE", + 0.001, 64, 256 + ) + trainer.info() +} diff --git a/11_code/creationalPatterns/BuilderExample/builderexample/src/main/kotlin/com/example/builderexample/ModelTrainer.kt b/11_code/creationalPatterns/BuilderExample/builderexample/src/main/kotlin/com/example/builderexample/ModelTrainer.kt new file mode 100644 index 0000000..c104704 --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/builderexample/src/main/kotlin/com/example/builderexample/ModelTrainer.kt @@ -0,0 +1,74 @@ +package com.example.builderexample + +class ModelTrainer { + var model: String + var trainDataloader: String + var validDataloader: String? = null + var testDataloader: String + var optimizer: String + var lossFunction: String + var learningRate: Double + var preProcessor: String? = null + var postProcessor: String? = null + var visualizer: String? = null + var batchSize: Int + var inputSize: Int + + constructor( + model: String, + trainDataloader: String, + testDataloader: String, + optimizer: String, + lossFunction: String, + learningRate: Double, + batchSize: Int, + inputSize: Int + ) { + this.model = model + this.trainDataloader = trainDataloader + this.testDataloader = testDataloader + this.optimizer = optimizer + this.lossFunction = lossFunction + this.learningRate = learningRate + this.batchSize = batchSize + this.inputSize = inputSize + } + + constructor( + model: String, + trainDataloader: String, + validDataloader: String, + testDataloader: String, + optimizer: String, + lossFunction: String, + learningRate: Double, + batchSize: Int, + inputSize: Int + ) : this( + model, + trainDataloader, + testDataloader, + optimizer, + lossFunction, + learningRate, + batchSize, + inputSize + ) { + this.validDataloader = validDataloader + } + + fun info() { + println("Model: $model") + println("Train DataLoader: $trainDataloader") + println("Valid DataLoader: $validDataloader") + println("Test DataLoader: $testDataloader") + println("Optimizer: $optimizer") + println("Loss Function: $lossFunction") + println("Learning Rate: $learningRate") + println("Pre Processor: $preProcessor") + println("Post Processor: $postProcessor") + println("Visualizer: $visualizer") + println("Batch Size: $batchSize") + println("Input Size: $inputSize") + } +} \ No newline at end of file diff --git a/11_code/creationalPatterns/BuilderExample/gradle.properties b/11_code/creationalPatterns/BuilderExample/gradle.properties new file mode 100644 index 0000000..3e927b1 --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/gradle.properties @@ -0,0 +1,21 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Enables namespacing of each library's R class so that its R class includes only the +# resources declared in the library itself and none from the library's dependencies, +# thereby reducing the size of the R class for that library +android.nonTransitiveRClass=true \ No newline at end of file diff --git a/11_code/creationalPatterns/BuilderExample/gradle/wrapper/gradle-wrapper.jar b/11_code/creationalPatterns/BuilderExample/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..e708b1c Binary files /dev/null and b/11_code/creationalPatterns/BuilderExample/gradle/wrapper/gradle-wrapper.jar differ diff --git a/11_code/creationalPatterns/BuilderExample/gradle/wrapper/gradle-wrapper.properties b/11_code/creationalPatterns/BuilderExample/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..608be23 --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Tue Nov 14 22:21:20 KST 2023 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/11_code/creationalPatterns/BuilderExample/gradlew b/11_code/creationalPatterns/BuilderExample/gradlew new file mode 100755 index 0000000..4f906e0 --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/11_code/creationalPatterns/BuilderExample/gradlew.bat b/11_code/creationalPatterns/BuilderExample/gradlew.bat new file mode 100644 index 0000000..ac1b06f --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/11_code/creationalPatterns/BuilderExample/local.properties b/11_code/creationalPatterns/BuilderExample/local.properties new file mode 100644 index 0000000..b0f77b7 --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/local.properties @@ -0,0 +1,8 @@ +## This file must *NOT* be checked into Version Control Systems, +# as it contains information specific to your local configuration. +# +# Location of the SDK. This is only used by Gradle. +# For customization when using a Version Control System, please read the +# header note. +#Thu Nov 13 11:00:11 KST 2025 +sdk.dir=C\:\\Users\\th\\AppData\\Local\\Android\\Sdk diff --git a/11_code/creationalPatterns/BuilderExample/settings.gradle.kts b/11_code/creationalPatterns/BuilderExample/settings.gradle.kts new file mode 100644 index 0000000..00644d4 --- /dev/null +++ b/11_code/creationalPatterns/BuilderExample/settings.gradle.kts @@ -0,0 +1,18 @@ +pluginManagement { + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} + +rootProject.name = "BuilderExample" +include(":app") +include(":builderexample") diff --git a/11_code/creationalPatterns/CreationalPatternPractice/.gradle/8.5/checksums/checksums.lock b/11_code/creationalPatterns/CreationalPatternPractice/.gradle/8.5/checksums/checksums.lock new file mode 100644 index 0000000..8df3bf9 Binary files /dev/null and b/11_code/creationalPatterns/CreationalPatternPractice/.gradle/8.5/checksums/checksums.lock differ diff --git a/11_code/creationalPatterns/CreationalPatternPractice/.gradle/8.5/dependencies-accessors/dependencies-accessors.lock b/11_code/creationalPatterns/CreationalPatternPractice/.gradle/8.5/dependencies-accessors/dependencies-accessors.lock new file mode 100644 index 0000000..a82ee59 Binary files /dev/null and b/11_code/creationalPatterns/CreationalPatternPractice/.gradle/8.5/dependencies-accessors/dependencies-accessors.lock differ diff --git a/11_code/creationalPatterns/CreationalPatternPractice/.gradle/8.5/dependencies-accessors/gc.properties b/11_code/creationalPatterns/CreationalPatternPractice/.gradle/8.5/dependencies-accessors/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/11_code/creationalPatterns/CreationalPatternPractice/.gradle/8.5/executionHistory/executionHistory.bin b/11_code/creationalPatterns/CreationalPatternPractice/.gradle/8.5/executionHistory/executionHistory.bin new file mode 100644 index 0000000..8bdd644 Binary files /dev/null and b/11_code/creationalPatterns/CreationalPatternPractice/.gradle/8.5/executionHistory/executionHistory.bin differ diff --git a/11_code/creationalPatterns/CreationalPatternPractice/.gradle/8.5/executionHistory/executionHistory.lock b/11_code/creationalPatterns/CreationalPatternPractice/.gradle/8.5/executionHistory/executionHistory.lock new file mode 100644 index 0000000..f0cc11c Binary files /dev/null and b/11_code/creationalPatterns/CreationalPatternPractice/.gradle/8.5/executionHistory/executionHistory.lock differ diff --git a/11_code/creationalPatterns/CreationalPatternPractice/.gradle/8.5/fileChanges/last-build.bin b/11_code/creationalPatterns/CreationalPatternPractice/.gradle/8.5/fileChanges/last-build.bin new file mode 100644 index 0000000..f76dd23 Binary files /dev/null and b/11_code/creationalPatterns/CreationalPatternPractice/.gradle/8.5/fileChanges/last-build.bin differ diff --git a/11_code/creationalPatterns/CreationalPatternPractice/.gradle/8.5/fileHashes/fileHashes.bin b/11_code/creationalPatterns/CreationalPatternPractice/.gradle/8.5/fileHashes/fileHashes.bin new file mode 100644 index 0000000..b68f704 Binary files /dev/null and b/11_code/creationalPatterns/CreationalPatternPractice/.gradle/8.5/fileHashes/fileHashes.bin differ diff --git a/11_code/creationalPatterns/CreationalPatternPractice/.gradle/8.5/fileHashes/fileHashes.lock b/11_code/creationalPatterns/CreationalPatternPractice/.gradle/8.5/fileHashes/fileHashes.lock new file mode 100644 index 0000000..033a506 Binary files /dev/null and b/11_code/creationalPatterns/CreationalPatternPractice/.gradle/8.5/fileHashes/fileHashes.lock differ diff --git a/11_code/creationalPatterns/CreationalPatternPractice/.gradle/8.5/fileHashes/resourceHashesCache.bin b/11_code/creationalPatterns/CreationalPatternPractice/.gradle/8.5/fileHashes/resourceHashesCache.bin new file mode 100644 index 0000000..1c24685 Binary files /dev/null and b/11_code/creationalPatterns/CreationalPatternPractice/.gradle/8.5/fileHashes/resourceHashesCache.bin differ diff --git a/11_code/creationalPatterns/CreationalPatternPractice/.gradle/8.5/gc.properties b/11_code/creationalPatterns/CreationalPatternPractice/.gradle/8.5/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/11_code/creationalPatterns/CreationalPatternPractice/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/11_code/creationalPatterns/CreationalPatternPractice/.gradle/buildOutputCleanup/buildOutputCleanup.lock new file mode 100644 index 0000000..155c5c2 Binary files /dev/null and b/11_code/creationalPatterns/CreationalPatternPractice/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/11_code/creationalPatterns/CreationalPatternPractice/.gradle/buildOutputCleanup/cache.properties b/11_code/creationalPatterns/CreationalPatternPractice/.gradle/buildOutputCleanup/cache.properties new file mode 100644 index 0000000..7d2409b --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/.gradle/buildOutputCleanup/cache.properties @@ -0,0 +1,2 @@ +#Thu Nov 13 11:10:02 KST 2025 +gradle.version=8.5 diff --git a/11_code/creationalPatterns/CreationalPatternPractice/.gradle/buildOutputCleanup/outputFiles.bin b/11_code/creationalPatterns/CreationalPatternPractice/.gradle/buildOutputCleanup/outputFiles.bin new file mode 100644 index 0000000..e03cb6f Binary files /dev/null and b/11_code/creationalPatterns/CreationalPatternPractice/.gradle/buildOutputCleanup/outputFiles.bin differ diff --git a/11_code/creationalPatterns/CreationalPatternPractice/.gradle/config.properties b/11_code/creationalPatterns/CreationalPatternPractice/.gradle/config.properties new file mode 100644 index 0000000..d95df5a --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/.gradle/config.properties @@ -0,0 +1,2 @@ +#Thu Nov 13 11:09:53 KST 2025 +java.home=C\:\\Program Files\\Android\\Android Studio\\jbr diff --git a/11_code/creationalPatterns/CreationalPatternPractice/.gradle/file-system.probe b/11_code/creationalPatterns/CreationalPatternPractice/.gradle/file-system.probe new file mode 100644 index 0000000..fd18df9 Binary files /dev/null and b/11_code/creationalPatterns/CreationalPatternPractice/.gradle/file-system.probe differ diff --git a/11_code/creationalPatterns/CreationalPatternPractice/.gradle/vcs-1/gc.properties b/11_code/creationalPatterns/CreationalPatternPractice/.gradle/vcs-1/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/11_code/creationalPatterns/CreationalPatternPractice/.idea/.gitignore b/11_code/creationalPatterns/CreationalPatternPractice/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/11_code/creationalPatterns/CreationalPatternPractice/.idea/AndroidProjectSystem.xml b/11_code/creationalPatterns/CreationalPatternPractice/.idea/AndroidProjectSystem.xml new file mode 100644 index 0000000..4a53bee --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/.idea/AndroidProjectSystem.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/CreationalPatternPractice/.idea/caches/deviceStreaming.xml b/11_code/creationalPatterns/CreationalPatternPractice/.idea/caches/deviceStreaming.xml new file mode 100644 index 0000000..e5f298b --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/.idea/caches/deviceStreaming.xml @@ -0,0 +1,993 @@ + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/CreationalPatternPractice/.idea/compiler.xml b/11_code/creationalPatterns/CreationalPatternPractice/.idea/compiler.xml new file mode 100644 index 0000000..b86273d --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/CreationalPatternPractice/.idea/deploymentTargetSelector.xml b/11_code/creationalPatterns/CreationalPatternPractice/.idea/deploymentTargetSelector.xml new file mode 100644 index 0000000..b268ef3 --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/.idea/deploymentTargetSelector.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/CreationalPatternPractice/.idea/gradle.xml b/11_code/creationalPatterns/CreationalPatternPractice/.idea/gradle.xml new file mode 100644 index 0000000..73fed50 --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/.idea/gradle.xml @@ -0,0 +1,20 @@ + + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/CreationalPatternPractice/.idea/kotlinc.xml b/11_code/creationalPatterns/CreationalPatternPractice/.idea/kotlinc.xml new file mode 100644 index 0000000..e805548 --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/.idea/kotlinc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/CreationalPatternPractice/.idea/migrations.xml b/11_code/creationalPatterns/CreationalPatternPractice/.idea/migrations.xml new file mode 100644 index 0000000..f8051a6 --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/.idea/migrations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/CreationalPatternPractice/.idea/misc.xml b/11_code/creationalPatterns/CreationalPatternPractice/.idea/misc.xml new file mode 100644 index 0000000..74dd639 --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/.idea/misc.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/CreationalPatternPractice/.idea/runConfigurations.xml b/11_code/creationalPatterns/CreationalPatternPractice/.idea/runConfigurations.xml new file mode 100644 index 0000000..16660f1 --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/.idea/runConfigurations.xml @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/CreationalPatternPractice/.idea/vcs.xml b/11_code/creationalPatterns/CreationalPatternPractice/.idea/vcs.xml new file mode 100644 index 0000000..c2365ab --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/CreationalPatternPractice/.run/Run CreationalPattern.run.xml b/11_code/creationalPatterns/CreationalPatternPractice/.run/Run CreationalPattern.run.xml new file mode 100644 index 0000000..9c90921 --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/.run/Run CreationalPattern.run.xml @@ -0,0 +1,24 @@ + + + + + + + true + true + false + false + + + diff --git a/11_code/creationalPatterns/CreationalPatternPractice/CreationalPattern/.gitignore b/11_code/creationalPatterns/CreationalPatternPractice/CreationalPattern/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/CreationalPattern/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/11_code/creationalPatterns/CreationalPatternPractice/CreationalPattern/build.gradle.kts b/11_code/creationalPatterns/CreationalPatternPractice/CreationalPattern/build.gradle.kts new file mode 100644 index 0000000..00dd954 --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/CreationalPattern/build.gradle.kts @@ -0,0 +1,21 @@ +plugins { + id("java-library") + id("org.jetbrains.kotlin.jvm") + application +} + +group = "com.example" +version = "1.0-SNAPSHOT" + +dependencies { + implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.20") + testImplementation("junit:junit:4.13.2") +} + +kotlin { + jvmToolchain(21) +} + +application { + mainClass.set("com.example.creationalpattern.OperatingSystem") +} diff --git a/11_code/creationalPatterns/CreationalPatternPractice/CreationalPattern/src/main/kotlin/com/example/creationalpattern/AndroidLogger.kt b/11_code/creationalPatterns/CreationalPatternPractice/CreationalPattern/src/main/kotlin/com/example/creationalpattern/AndroidLogger.kt new file mode 100644 index 0000000..227033e --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/CreationalPattern/src/main/kotlin/com/example/creationalpattern/AndroidLogger.kt @@ -0,0 +1,20 @@ +package com.example.creationalpattern + +class AndroidLogger { + fun error(msg: String) { + // In practical, the below line is implemented using Toast or other logging tools + println("Error '$msg' to Toast.") + } + + fun warn(msg: String) { + println("Warn '$msg' to Toast.") + } + + fun info(msg: String) { + println("Info '$msg' to Toast.") + } + + fun debug(msg: String) { + println("Debug '$msg' to Toast.") + } +} diff --git a/11_code/creationalPatterns/CreationalPatternPractice/CreationalPattern/src/main/kotlin/com/example/creationalpattern/FileLogger.kt b/11_code/creationalPatterns/CreationalPatternPractice/CreationalPattern/src/main/kotlin/com/example/creationalpattern/FileLogger.kt new file mode 100644 index 0000000..6410410 --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/CreationalPattern/src/main/kotlin/com/example/creationalpattern/FileLogger.kt @@ -0,0 +1,20 @@ +package com.example.creationalpattern + +class FileLogger { + fun error(msg: String) { + // In practical, the below line is implemented using file I/O + println("Error '$msg' to file.") + } + + fun warn(msg: String) { + println("Warn '$msg' to file.") + } + + fun info(msg: String) { + println("Info '$msg' to file.") + } + + fun debug(msg: String) { + println("Debug'$msg' to file.") + } +} diff --git a/11_code/creationalPatterns/CreationalPatternPractice/CreationalPattern/src/main/kotlin/com/example/creationalpattern/MACLogger.kt b/11_code/creationalPatterns/CreationalPatternPractice/CreationalPattern/src/main/kotlin/com/example/creationalpattern/MACLogger.kt new file mode 100644 index 0000000..951571b --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/CreationalPattern/src/main/kotlin/com/example/creationalpattern/MACLogger.kt @@ -0,0 +1,19 @@ +package com.example.creationalpattern + +class MACLogger { + fun error(msg: String) { + println("Error '$msg' to console.") + } + + fun warn(msg: String) { + println("Warn '$msg' to console.") + } + + fun info(msg: String) { + println("Info '$msg' to console.") + } + + fun debug(msg: String) { + println("Debug '$msg' to console.") + } +} diff --git a/11_code/creationalPatterns/CreationalPatternPractice/CreationalPattern/src/main/kotlin/com/example/creationalpattern/NetworkLogger.kt b/11_code/creationalPatterns/CreationalPatternPractice/CreationalPattern/src/main/kotlin/com/example/creationalpattern/NetworkLogger.kt new file mode 100644 index 0000000..00a86d8 --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/CreationalPattern/src/main/kotlin/com/example/creationalpattern/NetworkLogger.kt @@ -0,0 +1,20 @@ +package com.example.creationalpattern + +class NetworkLogger { + fun error(msg: String) { + // In practical, the below line is implemented using networking + println("Error '$msg' to another server.") + } + + fun warn(msg: String) { + println("Warn '$msg' to another server.") + } + + fun info(msg: String) { + println("Info '$msg' to another server.") + } + + fun debug(msg: String) { + println("Debug '$msg' to another server.") + } +} diff --git a/11_code/creationalPatterns/CreationalPatternPractice/CreationalPattern/src/main/kotlin/com/example/creationalpattern/OperatingSystem.kt b/11_code/creationalPatterns/CreationalPatternPractice/CreationalPattern/src/main/kotlin/com/example/creationalpattern/OperatingSystem.kt new file mode 100644 index 0000000..a1ec3da --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/CreationalPattern/src/main/kotlin/com/example/creationalpattern/OperatingSystem.kt @@ -0,0 +1,49 @@ +package com.example.creationalpattern + +object OperatingSystem { + private const val type = "MAC" + + @JvmStatic + fun main(args: Array) { + adder() + multiplier() + } + + private fun adder() { + val loggerType = "File" + val message = "log from adder" + + if (loggerType == "MAC") { + val logger = MACLogger() + logger.error(message) + } else if (loggerType == "Android") { + val logger = AndroidLogger() + logger.error(message) + } else if (loggerType == "File") { + val logger = FileLogger() + logger.error(message) + } else if (loggerType == "Network") { + val logger = NetworkLogger() + logger.error(message) + } + } + + private fun multiplier() { + val loggerType = "Android" + val message = "log from multiplier" + + if (loggerType == "Mac") { + val logger = MACLogger() + logger.error(message) + } else if (loggerType == "Android") { + val logger = AndroidLogger() + logger.error(message) + } else if (loggerType == "File") { + val logger = FileLogger() + logger.error(message) + } else if (loggerType == "Network") { + val logger = NetworkLogger() + logger.error(message) + } + } +} diff --git a/11_code/creationalPatterns/CreationalPatternPractice/app/.gitignore b/11_code/creationalPatterns/CreationalPatternPractice/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/11_code/creationalPatterns/CreationalPatternPractice/app/build.gradle.kts b/11_code/creationalPatterns/CreationalPatternPractice/app/build.gradle.kts new file mode 100644 index 0000000..df9299f --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/app/build.gradle.kts @@ -0,0 +1,45 @@ +plugins { + id("com.android.application") + id("org.jetbrains.kotlin.android") +} + +android { + namespace = "com.example.creationalpattern" + compileSdk = 33 + + defaultConfig { + applicationId = "com.example.creationalpattern" + minSdk = 28 + targetSdk = 33 + versionCode = 1 + versionName = "1.0" + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = "1.8" + } +} + +dependencies { + implementation("androidx.appcompat:appcompat:1.6.1") + implementation("com.google.android.material:material:1.8.0") + implementation("org.jetbrains.kotlin:kotlin-stdlib:1.8.20") + testImplementation("junit:junit:4.13.2") + androidTestImplementation("androidx.test.ext:junit:1.1.5") + androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") +} diff --git a/11_code/creationalPatterns/CreationalPatternPractice/app/proguard-rules.pro b/11_code/creationalPatterns/CreationalPatternPractice/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/11_code/creationalPatterns/CreationalPatternPractice/app/src/androidTest/java/com/example/creationalpatternpractice/ExampleInstrumentedTest.java b/11_code/creationalPatterns/CreationalPatternPractice/app/src/androidTest/java/com/example/creationalpatternpractice/ExampleInstrumentedTest.java new file mode 100644 index 0000000..70f78c3 --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/app/src/androidTest/java/com/example/creationalpatternpractice/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.example.creationalpatternpractice; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("com.example.creationalpatternpractice", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/AndroidManifest.xml b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..aa4b1fa --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/AndroidManifest.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/drawable/ic_launcher_background.xml b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000..c209e78 Binary files /dev/null and b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000..b2dfe3d Binary files /dev/null and b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000..4f0f1d6 Binary files /dev/null and b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000..62b611d Binary files /dev/null and b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000..948a307 Binary files /dev/null and b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..1b9a695 Binary files /dev/null and b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000..28d4b77 Binary files /dev/null and b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9287f50 Binary files /dev/null and b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000..aa7d642 Binary files /dev/null and b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9126ae3 Binary files /dev/null and b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/values-night/themes.xml b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..aa8431d --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/values-night/themes.xml @@ -0,0 +1,16 @@ + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/values/colors.xml b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..f8c6127 --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/values/colors.xml @@ -0,0 +1,10 @@ + + + #FFBB86FC + #FF6200EE + #FF3700B3 + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + \ No newline at end of file diff --git a/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/values/strings.xml b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..c913fad --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + CreationalPatternPractice + \ No newline at end of file diff --git a/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/values/themes.xml b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..c41916b --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/values/themes.xml @@ -0,0 +1,16 @@ + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/xml/backup_rules.xml b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/xml/backup_rules.xml new file mode 100644 index 0000000..fa0f996 --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/xml/backup_rules.xml @@ -0,0 +1,13 @@ + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/xml/data_extraction_rules.xml b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/xml/data_extraction_rules.xml new file mode 100644 index 0000000..9ee9997 --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/app/src/main/res/xml/data_extraction_rules.xml @@ -0,0 +1,19 @@ + + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/CreationalPatternPractice/app/src/test/java/com/example/creationalpatternpractice/ExampleUnitTest.java b/11_code/creationalPatterns/CreationalPatternPractice/app/src/test/java/com/example/creationalpatternpractice/ExampleUnitTest.java new file mode 100644 index 0000000..499c211 --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/app/src/test/java/com/example/creationalpatternpractice/ExampleUnitTest.java @@ -0,0 +1,17 @@ +package com.example.creationalpatternpractice; + +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } +} \ No newline at end of file diff --git a/11_code/creationalPatterns/CreationalPatternPractice/build.gradle.kts b/11_code/creationalPatterns/CreationalPatternPractice/build.gradle.kts new file mode 100644 index 0000000..1515483 --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/build.gradle.kts @@ -0,0 +1,6 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +plugins { + id("com.android.application") version "8.1.3" apply false + id("org.jetbrains.kotlin.android") version "1.9.20" apply false + id("org.jetbrains.kotlin.jvm") version "1.9.20" apply false +} diff --git a/11_code/creationalPatterns/CreationalPatternPractice/gradle.properties b/11_code/creationalPatterns/CreationalPatternPractice/gradle.properties new file mode 100644 index 0000000..3e927b1 --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/gradle.properties @@ -0,0 +1,21 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Enables namespacing of each library's R class so that its R class includes only the +# resources declared in the library itself and none from the library's dependencies, +# thereby reducing the size of the R class for that library +android.nonTransitiveRClass=true \ No newline at end of file diff --git a/11_code/creationalPatterns/CreationalPatternPractice/gradle/wrapper/gradle-wrapper.jar b/11_code/creationalPatterns/CreationalPatternPractice/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..e708b1c Binary files /dev/null and b/11_code/creationalPatterns/CreationalPatternPractice/gradle/wrapper/gradle-wrapper.jar differ diff --git a/11_code/creationalPatterns/CreationalPatternPractice/gradle/wrapper/gradle-wrapper.properties b/11_code/creationalPatterns/CreationalPatternPractice/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..b6f5bad --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Mon Nov 06 22:27:05 KST 2023 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/11_code/creationalPatterns/CreationalPatternPractice/gradlew b/11_code/creationalPatterns/CreationalPatternPractice/gradlew new file mode 100755 index 0000000..4f906e0 --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/11_code/creationalPatterns/CreationalPatternPractice/gradlew.bat b/11_code/creationalPatterns/CreationalPatternPractice/gradlew.bat new file mode 100644 index 0000000..ac1b06f --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/11_code/creationalPatterns/CreationalPatternPractice/local.properties b/11_code/creationalPatterns/CreationalPatternPractice/local.properties new file mode 100644 index 0000000..6f28b51 --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/local.properties @@ -0,0 +1,8 @@ +## This file must *NOT* be checked into Version Control Systems, +# as it contains information specific to your local configuration. +# +# Location of the SDK. This is only used by Gradle. +# For customization when using a Version Control System, please read the +# header note. +#Thu Nov 13 11:09:53 KST 2025 +sdk.dir=C\:\\Users\\th\\AppData\\Local\\Android\\Sdk diff --git a/11_code/creationalPatterns/CreationalPatternPractice/settings.gradle.kts b/11_code/creationalPatterns/CreationalPatternPractice/settings.gradle.kts new file mode 100644 index 0000000..72c87cf --- /dev/null +++ b/11_code/creationalPatterns/CreationalPatternPractice/settings.gradle.kts @@ -0,0 +1,18 @@ +pluginManagement { + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} + +rootProject.name = "CreationalPatternPractice" +include(":app") +include(":CreationalPattern") diff --git a/11_code/creationalPatterns/FactoryMethodExample/.gitignore b/11_code/creationalPatterns/FactoryMethodExample/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +local.properties diff --git a/11_code/creationalPatterns/FactoryMethodExample/.idea/.gitignore b/11_code/creationalPatterns/FactoryMethodExample/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/11_code/creationalPatterns/FactoryMethodExample/.idea/.name b/11_code/creationalPatterns/FactoryMethodExample/.idea/.name new file mode 100644 index 0000000..37fa533 --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/.idea/.name @@ -0,0 +1 @@ +My FactoryMethodExample \ No newline at end of file diff --git a/11_code/creationalPatterns/FactoryMethodExample/.idea/AndroidProjectSystem.xml b/11_code/creationalPatterns/FactoryMethodExample/.idea/AndroidProjectSystem.xml new file mode 100644 index 0000000..4a53bee --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/.idea/AndroidProjectSystem.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/FactoryMethodExample/.idea/compiler.xml b/11_code/creationalPatterns/FactoryMethodExample/.idea/compiler.xml new file mode 100644 index 0000000..b86273d --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/FactoryMethodExample/.idea/deploymentTargetSelector.xml b/11_code/creationalPatterns/FactoryMethodExample/.idea/deploymentTargetSelector.xml new file mode 100644 index 0000000..b268ef3 --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/.idea/deploymentTargetSelector.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/FactoryMethodExample/.idea/gradle.xml b/11_code/creationalPatterns/FactoryMethodExample/.idea/gradle.xml new file mode 100644 index 0000000..cddd91b --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/.idea/gradle.xml @@ -0,0 +1,20 @@ + + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/FactoryMethodExample/.idea/kotlinc.xml b/11_code/creationalPatterns/FactoryMethodExample/.idea/kotlinc.xml new file mode 100644 index 0000000..e805548 --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/.idea/kotlinc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/FactoryMethodExample/.idea/migrations.xml b/11_code/creationalPatterns/FactoryMethodExample/.idea/migrations.xml new file mode 100644 index 0000000..f8051a6 --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/.idea/migrations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/FactoryMethodExample/.idea/misc.xml b/11_code/creationalPatterns/FactoryMethodExample/.idea/misc.xml new file mode 100644 index 0000000..b2c751a --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/FactoryMethodExample/.idea/runConfigurations.xml b/11_code/creationalPatterns/FactoryMethodExample/.idea/runConfigurations.xml new file mode 100644 index 0000000..16660f1 --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/.idea/runConfigurations.xml @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/FactoryMethodExample/.idea/vcs.xml b/11_code/creationalPatterns/FactoryMethodExample/.idea/vcs.xml new file mode 100644 index 0000000..def3818 --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/.idea/vcs.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/FactoryMethodExample/.run/Run FactoryMethodExample.run.xml b/11_code/creationalPatterns/FactoryMethodExample/.run/Run FactoryMethodExample.run.xml new file mode 100644 index 0000000..d22dd3f --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/.run/Run FactoryMethodExample.run.xml @@ -0,0 +1,24 @@ + + + + + + + true + true + false + false + + + diff --git a/11_code/creationalPatterns/FactoryMethodExample/FactoryMethodExample/.gitignore b/11_code/creationalPatterns/FactoryMethodExample/FactoryMethodExample/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/FactoryMethodExample/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/11_code/creationalPatterns/FactoryMethodExample/FactoryMethodExample/build.gradle.kts b/11_code/creationalPatterns/FactoryMethodExample/FactoryMethodExample/build.gradle.kts new file mode 100644 index 0000000..ca5a760 --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/FactoryMethodExample/build.gradle.kts @@ -0,0 +1,21 @@ +plugins { + id("java-library") + id("org.jetbrains.kotlin.jvm") + application +} + +group = "com.example" +version = "1.0-SNAPSHOT" + +dependencies { + implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.20") + testImplementation("junit:junit:4.13.2") +} + +kotlin { + jvmToolchain(21) +} + +application { + mainClass.set("com.example.factorymethodexample.ClientKt") +} diff --git a/11_code/creationalPatterns/FactoryMethodExample/FactoryMethodExample/src/main/kotlin/com/example/factorymethodexample/Client.kt b/11_code/creationalPatterns/FactoryMethodExample/FactoryMethodExample/src/main/kotlin/com/example/factorymethodexample/Client.kt new file mode 100644 index 0000000..1026f75 --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/FactoryMethodExample/src/main/kotlin/com/example/factorymethodexample/Client.kt @@ -0,0 +1,9 @@ +package com.example.factorymethodexample + +fun main(args: Array) { + val s22: Phone = GalaxyS22() + val s23: Phone = GalaxyS23() + + s22.info() + s23.info() +} diff --git a/11_code/creationalPatterns/FactoryMethodExample/FactoryMethodExample/src/main/kotlin/com/example/factorymethodexample/GalaxyS22.kt b/11_code/creationalPatterns/FactoryMethodExample/FactoryMethodExample/src/main/kotlin/com/example/factorymethodexample/GalaxyS22.kt new file mode 100644 index 0000000..12190fa --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/FactoryMethodExample/src/main/kotlin/com/example/factorymethodexample/GalaxyS22.kt @@ -0,0 +1,7 @@ +package com.example.factorymethodexample + +class GalaxyS22 : Phone { + override fun info() { + println("This is Galaxy S22.") + } +} diff --git a/11_code/creationalPatterns/FactoryMethodExample/FactoryMethodExample/src/main/kotlin/com/example/factorymethodexample/GalaxyS23.kt b/11_code/creationalPatterns/FactoryMethodExample/FactoryMethodExample/src/main/kotlin/com/example/factorymethodexample/GalaxyS23.kt new file mode 100644 index 0000000..32f4713 --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/FactoryMethodExample/src/main/kotlin/com/example/factorymethodexample/GalaxyS23.kt @@ -0,0 +1,7 @@ +package com.example.factorymethodexample + +class GalaxyS23 : Phone { + override fun info() { + println("This is Galaxy S23.") + } +} diff --git a/11_code/creationalPatterns/FactoryMethodExample/FactoryMethodExample/src/main/kotlin/com/example/factorymethodexample/Phone.kt b/11_code/creationalPatterns/FactoryMethodExample/FactoryMethodExample/src/main/kotlin/com/example/factorymethodexample/Phone.kt new file mode 100644 index 0000000..934bde3 --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/FactoryMethodExample/src/main/kotlin/com/example/factorymethodexample/Phone.kt @@ -0,0 +1,5 @@ +package com.example.factorymethodexample + +interface Phone { + fun info() +} diff --git a/11_code/creationalPatterns/FactoryMethodExample/app/.gitignore b/11_code/creationalPatterns/FactoryMethodExample/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/11_code/creationalPatterns/FactoryMethodExample/app/build.gradle.kts b/11_code/creationalPatterns/FactoryMethodExample/app/build.gradle.kts new file mode 100644 index 0000000..c505fee --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/app/build.gradle.kts @@ -0,0 +1,45 @@ +plugins { + id("com.android.application") + id("org.jetbrains.kotlin.android") +} + +android { + namespace = "com.example.factorymethodexample" + compileSdk = 33 + + defaultConfig { + applicationId = "com.example.factorymethodexample" + minSdk = 28 + targetSdk = 33 + versionCode = 1 + versionName = "1.0" + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = "1.8" + } +} + +dependencies { + implementation("androidx.appcompat:appcompat:1.6.1") + implementation("com.google.android.material:material:1.8.0") + implementation("org.jetbrains.kotlin:kotlin-stdlib:1.8.20") + testImplementation("junit:junit:4.13.2") + androidTestImplementation("androidx.test.ext:junit:1.1.5") + androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") +} \ No newline at end of file diff --git a/11_code/creationalPatterns/FactoryMethodExample/app/proguard-rules.pro b/11_code/creationalPatterns/FactoryMethodExample/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/11_code/creationalPatterns/FactoryMethodExample/app/src/androidTest/java/com/example/myfactorymethodexample/ExampleInstrumentedTest.kt b/11_code/creationalPatterns/FactoryMethodExample/app/src/androidTest/java/com/example/myfactorymethodexample/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..e6d0c70 --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/app/src/androidTest/java/com/example/myfactorymethodexample/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package com.example.myfactorymethodexample + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("com.example.myfactorymethodexample", appContext.packageName) + } +} \ No newline at end of file diff --git a/11_code/creationalPatterns/FactoryMethodExample/app/src/androidTest/java/com/example/simpleexample/ExampleInstrumentedTest.java b/11_code/creationalPatterns/FactoryMethodExample/app/src/androidTest/java/com/example/simpleexample/ExampleInstrumentedTest.java new file mode 100644 index 0000000..1cbf600 --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/app/src/androidTest/java/com/example/simpleexample/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.example.simpleexample; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("com.example.simpleexample", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/11_code/creationalPatterns/FactoryMethodExample/app/src/main/AndroidManifest.xml b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..44f285e --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/AndroidManifest.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/drawable/ic_launcher_background.xml b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/drawable/ic_launcher_foreground.xml b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-anydpi/ic_launcher.xml b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-anydpi/ic_launcher.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-anydpi/ic_launcher.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-anydpi/ic_launcher_round.xml b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-anydpi/ic_launcher_round.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-anydpi/ic_launcher_round.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000..c209e78 Binary files /dev/null and b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000..b2dfe3d Binary files /dev/null and b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000..4f0f1d6 Binary files /dev/null and b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000..62b611d Binary files /dev/null and b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000..948a307 Binary files /dev/null and b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..1b9a695 Binary files /dev/null and b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000..28d4b77 Binary files /dev/null and b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9287f50 Binary files /dev/null and b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000..aa7d642 Binary files /dev/null and b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9126ae3 Binary files /dev/null and b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/values-night/themes.xml b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..b2abc26 --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/values-night/themes.xml @@ -0,0 +1,16 @@ + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/values/colors.xml b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..f8c6127 --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/values/colors.xml @@ -0,0 +1,10 @@ + + + #FFBB86FC + #FF6200EE + #FF3700B3 + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + \ No newline at end of file diff --git a/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/values/strings.xml b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..b830972 --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + SimpleExample + \ No newline at end of file diff --git a/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/values/themes.xml b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..26fa092 --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/values/themes.xml @@ -0,0 +1,16 @@ + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/xml/backup_rules.xml b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/xml/backup_rules.xml new file mode 100644 index 0000000..fa0f996 --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/xml/backup_rules.xml @@ -0,0 +1,13 @@ + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/xml/data_extraction_rules.xml b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/xml/data_extraction_rules.xml new file mode 100644 index 0000000..9ee9997 --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/app/src/main/res/xml/data_extraction_rules.xml @@ -0,0 +1,19 @@ + + + + + + + \ No newline at end of file diff --git a/11_code/creationalPatterns/FactoryMethodExample/app/src/test/java/com/example/myfactorymethodexample/ExampleUnitTest.kt b/11_code/creationalPatterns/FactoryMethodExample/app/src/test/java/com/example/myfactorymethodexample/ExampleUnitTest.kt new file mode 100644 index 0000000..7fee073 --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/app/src/test/java/com/example/myfactorymethodexample/ExampleUnitTest.kt @@ -0,0 +1,17 @@ +package com.example.myfactorymethodexample + +import org.junit.Test + +import org.junit.Assert.* + +/** + * Example local unit test, which will execute on the development machine (host). + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +class ExampleUnitTest { + @Test + fun addition_isCorrect() { + assertEquals(4, 2 + 2) + } +} \ No newline at end of file diff --git a/11_code/creationalPatterns/FactoryMethodExample/app/src/test/java/com/example/simpleexample/ExampleUnitTest.java b/11_code/creationalPatterns/FactoryMethodExample/app/src/test/java/com/example/simpleexample/ExampleUnitTest.java new file mode 100644 index 0000000..d6a084d --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/app/src/test/java/com/example/simpleexample/ExampleUnitTest.java @@ -0,0 +1,17 @@ +package com.example.simpleexample; + +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } +} \ No newline at end of file diff --git a/11_code/creationalPatterns/FactoryMethodExample/build.gradle.kts b/11_code/creationalPatterns/FactoryMethodExample/build.gradle.kts new file mode 100644 index 0000000..80e45f3 --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/build.gradle.kts @@ -0,0 +1,6 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +plugins { + id("com.android.application") version "8.1.3" apply false + id("org.jetbrains.kotlin.android") version "1.9.20" apply false + id("org.jetbrains.kotlin.jvm") version "1.9.20" apply false +} \ No newline at end of file diff --git a/11_code/creationalPatterns/FactoryMethodExample/gradle.properties b/11_code/creationalPatterns/FactoryMethodExample/gradle.properties new file mode 100644 index 0000000..3e927b1 --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/gradle.properties @@ -0,0 +1,21 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Enables namespacing of each library's R class so that its R class includes only the +# resources declared in the library itself and none from the library's dependencies, +# thereby reducing the size of the R class for that library +android.nonTransitiveRClass=true \ No newline at end of file diff --git a/11_code/creationalPatterns/FactoryMethodExample/gradle/libs.versions.toml b/11_code/creationalPatterns/FactoryMethodExample/gradle/libs.versions.toml new file mode 100644 index 0000000..b23a4ab --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/gradle/libs.versions.toml @@ -0,0 +1,22 @@ +[versions] +agp = "8.12.1" +kotlin = "2.0.21" +coreKtx = "1.17.0" +junit = "4.13.2" +junitVersion = "1.3.0" +espressoCore = "3.7.0" +appcompat = "1.6.1" +material = "1.10.0" + +[libraries] +androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" } +junit = { group = "junit", name = "junit", version.ref = "junit" } +androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" } +androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" } +androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" } +material = { group = "com.google.android.material", name = "material", version.ref = "material" } + +[plugins] +android-application = { id = "com.android.application", version.ref = "agp" } +kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } + diff --git a/11_code/creationalPatterns/FactoryMethodExample/gradle/wrapper/gradle-wrapper.jar b/11_code/creationalPatterns/FactoryMethodExample/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..e708b1c Binary files /dev/null and b/11_code/creationalPatterns/FactoryMethodExample/gradle/wrapper/gradle-wrapper.jar differ diff --git a/11_code/creationalPatterns/FactoryMethodExample/gradle/wrapper/gradle-wrapper.properties b/11_code/creationalPatterns/FactoryMethodExample/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..fe5b3d8 --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Tue Nov 14 15:45:03 KST 2023 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/11_code/creationalPatterns/FactoryMethodExample/gradlew b/11_code/creationalPatterns/FactoryMethodExample/gradlew new file mode 100755 index 0000000..4f906e0 --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/11_code/creationalPatterns/FactoryMethodExample/gradlew.bat b/11_code/creationalPatterns/FactoryMethodExample/gradlew.bat new file mode 100644 index 0000000..ac1b06f --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/11_code/creationalPatterns/FactoryMethodExample/settings.gradle.kts b/11_code/creationalPatterns/FactoryMethodExample/settings.gradle.kts new file mode 100644 index 0000000..e7e1386 --- /dev/null +++ b/11_code/creationalPatterns/FactoryMethodExample/settings.gradle.kts @@ -0,0 +1,24 @@ +pluginManagement { + repositories { + google { + content { + includeGroupByRegex("com\\.android.*") + includeGroupByRegex("com\\.google.*") + includeGroupByRegex("androidx.*") + } + } + mavenCentral() + gradlePluginPortal() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} + +rootProject.name = "My FactoryMethodExample" +include(":app") +include(":FactoryMethodExample") \ No newline at end of file